c++ solution (lis)
\nclass Solution {\npublic:\n    vector<int> largestDivisibleSubset(vector<int>& nums) \n    {\n        sort(nums.begin(),nums.end());\n        int index=0;\n  
```\nclass Solution {\npublic:\n    vector<int> largestDivisibleSubset(vector<int>& nums) \n    {\n        sort(nums.begin(),nums.end());\n        int index=0;\n        int n=nums.size();\n        vector<int>dp(n,1);\n        vector<int>parent(n,-1);\n        for(int i=0;i<n;i++)\n        {\n            for(int j=0;j<i;j++)\n            {\n                if(nums[i]%nums[j]==0&&dp[i]<dp[j]+1)\n                {\n                    dp[i]=dp[j]+1;\n                    parent[i]=j;\n                }\n            }\n            if(dp[i]>dp[index])\n            {\n                index=i;\n            }\n        }\n        vector<int>ans;\n        while(index>=0)\n        {\n            ans.push_back(nums[index]);\n            index=parent[index];\n        }\n        return ans;\n    }\n};\n```
['C', 'C++']