i am not able to know if n>list.size
then what to do
code link:https://ide.codingblocks.com/s/141058
2 test cases fail
Hi Rohan,
If k>n i.e. number of elements to be appended exceeds n, use k = k%n. Because after n appending operations all the elements will be back to their original position.
So in this case:
7
1 2 2 1 8 5 6
10
After 7 times, the linked list will be back to its original position. And then we have to do the appending for 3 times again.