Advertisement
Guest User

8. Magic Sum

a guest
Oct 17th, 2018
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. 8. Magic Sum
  2. Write a JS function, which prints all unique pairs in an array of integers whose sum is equal to a given number.
  3.  
  4. Examples:
  5. Input Output
  6. ['1 7 6 2 19 23', '8'] 1 7
  7. 6 2
  8.  
  9. ['14 20 60 13 7 19 8', '27'] 14 13
  10. 20 7
  11. 19 8
  12.  
  13. ['1 2 3 4 5 6', '6'] 1 5
  14. 2 4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement