✅ JS || With explanation || Easy to understand || Simple
I just found this Blog and Github repository with solutions to Leetcode problems.\nhttps://leet-codes.blogspot.com/2022/10/largest-perimeter-triangle.html\nIt i
I just found this Blog and Github repository with solutions to Leetcode problems.\nhttps://leet-codes.blogspot.com/2022/10/largest-perimeter-triangle.html\nIt is very useful, and I just wanted to share it with you. \nYou can bookmark it as a resource \n\n```\n/**\n * @param {number[]} nums\n * @return {number}\n */\nvar largestPerimeter = function(nums) {\n    nums.sort((a, b) => b - a);\n      const N = nums.length - 2;\n      for (let i = 0; i < N; i++) {\n        if (nums[i] < nums[i + 1] + nums[i + 2]) return nums[i] + nums[i + 1] + nums[i + 2];\n      }\n      return 0;\n};\n```\n\n```\nRuntime: 191 ms, faster than 13.37% of JavaScript online submissions for Largest Perimeter Triangle.\nMemory Usage: 45.3 MB, less than 75.97% of JavaScript online submissions for Largest Perimeter Triangle.\n```
['JavaScript']