JAVA Solution Explained in HINDI
https://youtu.be/VZ9M6Mdu460\n\nFor explanation, please watch the above video and do like, share and subscribe the channel. \u2764\uFE0F Also, please do upvote 
https://youtu.be/VZ9M6Mdu460\n\nFor explanation, please watch the above video and do like, share and subscribe the channel. \u2764\uFE0F Also, please do upvote the solution if you liked it.\n\nSubscribe link:- https://youtube.com/@reelcoding?si=QjbKCii_i2CPwPIu\n\nSubscribe Goal:- 200\nCurrent Subscriber:- 104\n\n# Code\n```\nclass Solution {\n    public List<Integer> largestDivisibleSubset(int[] nums) {\n        \n        int n = nums.length;\n        int count[] = new int[n];\n        int pre[] = new int[n];\n\n        Arrays.sort(nums);\n        int max = 0, index = -1;\n\n        for(int i = 0; i < n; i++) {\n            count[i] = 1;\n            pre[i] = -1;\n\n            for(int j = i-1; j >= 0; j--) {\n                if(nums[i] % nums[j] == 0) {\n                    if(1 + count[j] > count[i]) {\n                        count[i] = count[j] + 1;\n                        pre[i] = j;\n                    }\n                }\n            }\n            if(count[i] > max) {\n                max = count[i];\n                index = i;\n            }\n        }\n        List<Integer> res = new ArrayList<>();\n        while(index != -1) {\n            res.add(nums[index]);\n            index = pre[index];\n        }\n        return res;\n    }\n}\n```
['Java']