天天看點

leetcode - Rotate List

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

For example:

Given <code>1-&gt;2-&gt;3-&gt;4-&gt;5-&gt;NULL</code> and k = <code>2</code>,

return <code>4-&gt;5-&gt;1-&gt;2-&gt;3-&gt;NULL</code>.