JAVA || O(nlogn) || EASY TO UNDERSTAND || SIMPLE SOLUTION
IF YOU LIKE THE SOLUTION \nDON\'T FORGET TO UPVOTE IT.\n\nclass Solution {\n    public int largestPerimeter(int[] nums) {\n        \n        //Sort the array fi
IF YOU LIKE THE SOLUTION \nDON\'T FORGET TO UPVOTE IT.\n```\nclass Solution {\n    public int largestPerimeter(int[] nums) {\n        \n        //Sort the array first.\n        Arrays.sort(nums);\n        \n        //Start traversing from back , so that we can get the largest value.\n        for(int i = nums.length-1; i>1; i--){\n            //Using triangle property to become valid sides\n            // The sum of the length of the two sides of a triangle is greater than the length of the third side. \n           if(nums[i] < nums[i-1] + nums[i-2])\n               return  nums[i] + nums[i-1]+ nums[i-2];   \n        }\n        \n        //If we didn\'t found anything we return 0.\n        return 0;\n    }\n   \n}\n```
['Sorting', 'Java']