Advertisement
Guest User

Untitled

a guest
Jul 24th, 2017
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. // you can write to stdout for debugging purposes, e.g.
  2. // console.log('this is a debug message');
  3.  
  4. function solution(A) {
  5. // write your code in JavaScript (Node.js 6.4.0)
  6. let len = A.length;
  7. A = A.sort((a,b) => a-b)
  8. for(let i=0;i<len-2;i++) {
  9. if(A[i] + A[i+1] > A[i+2]) {
  10. return 1;
  11. }
  12. }
  13. return 0;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement