Easy sorting c++
Upvote will be highly appreciated\n\nclass Solution {\npublic:\n\n    int largestPerimeter(vector& nums) {\n        sort(nums.rbegin(),nums.rend());\n        \n
Upvote will be highly appreciated\n\nclass Solution {\npublic:\n\n    int largestPerimeter(vector<int>& nums) {\n        sort(nums.rbegin(),nums.rend());\n        \n        \n        for(int i = 0; i<nums.size()-2; i++){\n            if(nums[i]<nums[i+1]+nums[i+2]){\n                return nums[i]+nums[i+1]+nums[i+2];\n            }\n        }\n        return 0;\n    }\n};
[]