Advertisement
Guest User

Untitled

a guest
Mar 24th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. [4,1,4,-1,2]
  2. [3,4,4,-1,2]
  3. [3,2,4,-1,2]
  4. [3,1,4, 2,2]
  5.  
  6. [] -> []
  7. [1] -> [1]
  8. [1,2] -> [2,2]
  9. [2,1] -> [2,1]
  10. [4,4,4,4] -> [4,4,4,4]
  11. [-1,-3,-10] -> [-1,-3,-10]
  12. [1,3,10] -> [3,3,10] [10,3,10] [1,10,10]
  13. [1,1,2,1] -> [2,1,2,1] [1,2,2,1]
  14. [998,64,2,-94,-789] -> [998,64,2,-94,-789]
  15. [998,2,64,-94,-789] -> [998,64,64,-94,-789]
  16. [3,1,4,-1,2] -> [4,1,4,-1,2] [3,4,4,-1,2] [3,2,4,-1,2] [3,1,4,2,2]
  17. [-1,4,0,4,7,2,3] -> [4,4,0,4,7,2,3] [0,4,0,4,7,2,3] [-1,4,4,4,7,2,3] [7,4,0,4,7,2,3] [-1,7,0,4,7,2,3] [-1,4,7,4,7,2,3] [-1,4,0,7,7,2,3] [2,4,0,4,7,2,3] [-1,4,2,4,7,2,3] [3,4,0,4,7,2,3] [-1,4,3,4,7,2,3] [-1,4,0,4,7,3,3]
  18. [3542,-12311,7662,1672,6081] -> [7662,-12311,7662,1672,6081] [3542,7662,7662,1672,6081] [3542,1672,7662,1672,6081] [6081,-12311,7662,1672,6081] [3542,6081,7662,1672,6081] [3542,-12311,7662,6081,6081]
  19.  
  20. x=>x.reduceRight((p,c)=>[c<m&&d?(d=0,m):m=c,...p],[],d=m=-1/0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement