[Rotate List] there is a better solution
Opened this issue · 3 comments
Deleted user commented
leetcode/src/rotateList/rotateList.cpp
Lines 35 to 36 in ad62b9d
Given the length n, you only need to loop about n~2n times if k is much more bigger than n.
haoel commented
You are right! let me do some improvement.
haoel commented
code change : 356254b
(oops, seems github misses match the code commit message to close the issue.)
Deleted user commented
Great, more interesting than my two pointers version.