Javascript 4 lines, Sort
The longest length of a side of a triangle is smaller than sum of  other two sides lengths.\nthe array is sorted descending  and check each A[i]<A[i+1]+A[i+2], 
The longest length of a side of a triangle is smaller than sum of  other two sides lengths.\nthe array is sorted descending  and check each A[i]<A[i+1]+A[i+2], A[i] is always max(A[i+1],A[i+2])\n```\nvar largestPerimeter = function(A) {\n\tA.sort(function(a, b) { return b - a; });    \n\tfor(let i=0;i<A.length-2;i++){\n\t\tlet sum = A[i+1] + A[i+2];\n\t\tif (sum > A[i]) return sum + A[i];\n\t }\n\treturn 0;  \n}\n```
[]