Easy understanding beginner friendly . Please Upvote if understood
class Solution {\npublic:\n\n    int largestPerimeter(vector& v) {\n        sort(v.begin(),v.end());\n        int n=v.size();\n        for(int i=n-1;i>1;i--){\n
class Solution {\npublic:\n\n    int largestPerimeter(vector<int>& v) {\n        sort(v.begin(),v.end());\n        int n=v.size();\n        for(int i=n-1;i>1;i--){\n            int c=v[i];\n            int a=v[i-1];\n            int b=v[i-2];\n            if(c<a+b)\n                return a+b+c;\n        }\n        return 0;\n    }\n};
['Greedy']