C++ || 4  LINES || SORT || EASY UNDERSTANDABLE || SINGLE PASS
As, we know that the basic condition to make a triangle is (a+b>c).\nNow, we sort the given array in the "non-decreasing" order to get the maximum values at rig
As, we know that the basic condition to make a triangle is (a+b>c).\nNow, we sort the given array in the "non-decreasing" order to get the maximum values at right hand side only.\nWe choose most three greatest side and checks whether it can form a triangle or not, If the sides forms a triangle we return the sum of those three sides.\nMY CODE WITH **O(NlogN)** TIME COMPLEXITY IS GIVEN BELOW:\n```\nclass Solution {\npublic:\n    int largestPerimeter(vector<int>& nums) {\n        sort(nums.begin(),nums.end());\n        for(int i=nums.size()-1;i>=2;i--)\n            if(nums[i]<nums[i-1]+nums[i-2])\n                return nums[i]+nums[i-1]+nums[i-2];\n        return 0;\n    }\n};\n```
['Array', 'C', 'Sorting']