You are viewing a single comment's thread. Return to all comments →
js
function maximumPerimeterTriangle(s) { s.sort((a,b) => b-a) for (let i=2; i<s.length; i++) { const [a,b,c] = [s[i],s[i-1],s[i-2]]; if (a+b>c) return [a,b,c] } return [-1] }
Seems like cookies are disabled on this browser, please enable them to open this website
Maximum Perimeter Triangle
You are viewing a single comment's thread. Return to all comments →
js