My python solution
\nclass Solution(object):\n    def largestDivisibleSubset(self, nums):\n        """\n        :type nums: List[int]\n        :rtype: List[int]\n        """\n    
```\nclass Solution(object):\n    def largestDivisibleSubset(self, nums):\n        """\n        :type nums: List[int]\n        :rtype: List[int]\n        """\n        n = len(nums)\n        if n == 0:\n            return []\n        nums.sort()\n        dp    = [[]]*n\n        dp[0] = [nums[0]]\n        maxdp = dp[0]\n        \n        for i in range(1,n):\n            dp[i] = [nums[i]]\n            for j in range(i):\n                if nums[i]%dp[j][-1] == 0 and len(dp[i]) < len(dp[j]) + 1:\n                    dp[i] = dp[j] + [ nums[i] ]\n            if len(maxdp) < len(dp[i]):\n                maxdp = dp[i]\n\n        return maxdp\n```
[]