Simple clean Java Solution DFS Backtrack
\nclass Solution {\n    List<Integer> res;\n    int max=-1;\n    public List<Integer> largestDivisibleSubset(int[] nums) {\n        Arrays.sort(nums);\n        
```\nclass Solution {\n    List<Integer> res;\n    int max=-1;\n    public List<Integer> largestDivisibleSubset(int[] nums) {\n        Arrays.sort(nums);\n        help(nums,0,new ArrayList<>());\n        return res;\n    }\n    void help(int[] nums,int s,List<Integer> temp)\n    {\n        if(temp.size()>max)\n        {\n            max=temp.size();\n            res=new ArrayList<>(temp);\n        }\n        \n        for(int i=s;i<nums.length;i++)\n        {\n            if(temp.isEmpty() || nums[i]%temp.get(temp.size()-1)==0)\n            {\n                temp.add(nums[i]);\n                help(nums,i+1,temp);\n                temp.remove(temp.size()-1);\n            }\n        }\n    }\n}\n```
[]