Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1.  
  2. Given an array of integers, some elements appear twice and others appear once. Each integer is in the range of [1, N], where N is the number of elements in the array.
  3.  
  4. Find all the integers of [1, N] inclusive that do NOT appear in this array.
  5.  
  6. Input
  7. Read from the standard input:
  8.  
  9. There is one line of input, containing N amount of integers, seperated by a comma (",")
  10. Output
  11. Print to the standard output:
  12.  
  13. There is one line of output, containing the sorted integers, seperated by a comma (",")
  14. Constraints
  15. N will always be in the range of [5, 1000]
  16. Sample Tests
  17. Input
  18. Copy
  19. 1,2,3,3,5
  20. Output
  21. Copy
  22. 4
  23. Input
  24. Copy
  25. 4,3,2,7,8,2,3,1
  26. Output
  27. Copy
  28. 5,6
  29. Input
  30. Copy
  31. 1,1,1,1,1,1,1,1
  32. Output
  33. Copy
  34. 2,3,4,5,6,7,8
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement