Advertisement
xapu

Untitled

Jan 25th, 2018
400
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. let passArr = [
  2. [1, 2, 3, 4, 5],
  3. [2, 2, 3, 4, 5],
  4. [3, 2, 3, 4, 5],
  5. [4, 2, 3, 4, 5],
  6. [5, 2, 3, 4, 5]
  7. ]
  8.  
  9. let noPassArr = [
  10. [1, 2, 3, 4, 5],
  11. [2, 2, 3, 4, 5],
  12. [3, 2, 3, 4, 5],
  13. [4, 2, 3, 4, 5],
  14. [6, 2, 3, 4, 5]
  15. ]
  16.  
  17. let checker = arr =>
  18. arr.reduce((acc, x) => acc + x[0], 0) ===
  19. arr[0].reduce((acc, x) => acc + x, 0)
  20.  
  21. console.log(checker(passArr))
  22. console.log(checker(noPassArr))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement