✔ Simple c++ solution using sorting
In this we first sort the array then we are checking for each interval of length 3 of array. By triangle property, i.e. sum of two sides must be greater than la
In this we first sort the array then we are checking for each interval of length 3 of array. By triangle property, i.e. sum of two sides must be greater than largest side of the triangle.\n\n```\nint largestPerimeter(vector<int>& nums) {\n        sort(nums.begin(),nums.end());\n        int sum=0;\n        for(int i=0;i<nums.size()-2;i++){\n            if(nums[i]+nums[i+1]>nums[i+2]){\n                sum=max(sum,nums[i]+nums[i+1]+nums[i+2]);\n            }\n        }\n        return sum;\n    }\n```\nIf any doubt then feel free to ask !!\nIf you get some value from this, then show some love by upvoting it !!\nHappy Coding \uD83D\uDE0A
['C', 'C++']