c++ | 99% faster than all | easy
\n# Code\n\nclass Solution {\npublic:\n     int largestPerimeter(vector<int>& nums) {\n        sort(nums.begin() , nums.end());\n        int n = nums.size();  \
\n# Code\n```\nclass Solution {\npublic:\n     int largestPerimeter(vector<int>& nums) {\n        sort(nums.begin() , nums.end());\n        int n = nums.size();  \n        for(int i = n-1;i>1;i--)\n\t\t      if(nums[i] < nums[i-1] + nums[i-2]) return nums[i] + nums[i-1] + nums[i-2];\n        return 0;\n    }\n};\n```
['C++']