Guest User

Untitled

a guest
Apr 22nd, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.19 KB | None | 0 0
  1. function solution(A) {
  2. // write your code in JavaScript (Node.js 8.9.4)
  3. const B = A.sort((a,b)=>a-b).slice();
  4. return Math.max(B.shift()*B.shift()*B.pop(), A.pop()*A.pop()*A.pop());
  5. }
Add Comment
Please, Sign In to add comment