Rotate List

Given a list, rotate the list to the right by k places, where k is non-negative.

For example:

Given 1->2->3->4->5->NULL and k = 2,
return 4->5->1->2->3->NULL.

Interview Code Editor
  • Hint 1
  • Solution Approach
  • Complete Solution
6459 successful submissions.
Asked In:
  • Amazon
Click here to jump start your coding interview preparation