Cut and join

  • find the length of the linked list len
  • make sure n < len, n = n % len
  • cut at len - n - 1
  • join the tail and head of the linked list