JavaScript easy solution
javascript\n/**\n * @param {number[]} A\n * @return {number}\n */\nvar largestPerimeter = function(A) {\n  A.sort((a, b) => b - a);\n  const N = A.length - 2;\n
```javascript\n/**\n * @param {number[]} A\n * @return {number}\n */\nvar largestPerimeter = function(A) {\n  A.sort((a, b) => b - a);\n  const N = A.length - 2;\n  for (let i = 0; i < N; i++) {\n    if (A[i] < A[i + 1] + A[i + 2]) return A[i] + A[i + 1] + A[i + 2];\n  }\n  return 0;\n};\n```\n\n* 84/84 cases passed (92 ms)\n* Your runtime beats 86.17 % of javascript submissions\n* Your memory usage beats 100 % of javascript submissions (38.2 MB)
['JavaScript']