what action needs to be taken if k>n in linked list k append
What action needs to be taken if k>n in linked list k append
@namrata7488
Consider this testcase
Input :
7
1 2 3 4 5 6 7
10
Expected Output :
5 6 7 1 2 3 4
Just take the modulo of k with n .
k = k % n
Note : Do not forget to consider the corner case when k is a multiple of 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.