LinkedList-K Append

how k can be greater than N
it’s means rotated one
1 2 2 1 8 5 6
k=10
output :1 2 2 1 8 5 6 6 5 8 1 2 2 1

clarify the question if I am wrong

hey Akash, when K>N than K would be K%N.Consider the following example

1 2 2 1 8 5 6, N=7 and K=10
answer should be 8 5 6 1 2 2 1

explanation: K=7 mean take all 7 element from end put them in front.Therefore array remain same. now out of 10, 7 is used up, So for left 3, you need to append last 3 to front.
So You can say whenever K>N,than K=K%N;

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.