Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1) run iterator 'a' to kth element
- 2) start iterator 'b' from head
- 3) proceed iterator 'a' to the end of list, stepping 'b' each time when you step 'a'
- end) 'a' arrives to last element, 'b' arrives to 'kth to last' at the same time.
Add Comment
Please, Sign In to add comment