if we ignore the note,"Given n will always be valid", how we handle the situation that n is bigger than the length of the linked list?
you want do something like n % lengthOfTheList
n % lengthOfTheList
That depends on the requirement. I think you should confirm that with the person who gives you the problem. "%" is just one way
In the current problem, you can track the 'Next' pointer. If it goes to NULL before it reaches 'n' then just return NULL.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.