C++ Beginner Level Solution
Here I\'ve sorted the vector nums and then searched triplets starting from the end.\n\nAs we know, for three sides to be a triangle it has to have two sides sum
Here I\'ve sorted the vector nums and then searched triplets starting from the end.\n\nAs we know, for three sides to be a triangle it has to have **two sides sum that is bigger than the third one**.\n\n```\nsort(nums.begin(),nums.end());\n        \n        for(int i=nums.size()-3;i>=0;i--){\n            if(nums[i]+nums[i+1]>nums[i+2])\n                return nums[i]+nums[i+1]+nums[i+2];            \n        }\n        return 0;\n\n```\nupvote if you find this helpful. Thanks.
['Array', 'Sorting', 'C++']