why only one case is passing
i think my algorithm is correct
please tell me the error
K append linked list
hello @divyam_13 try for the test cases in which k is bigger than n .
you will definitely be able to pass more test cases if you think your algorithm is correct .
if you still have any doubt please reply here we will discuss .
like for the test case .
5
1 3 5 7 9
6
output should be
9 1 3 5 7
but your code is not even printing correct for the sample test case .
please tell me the problem i am not able to solve it
i did something like this for k>n
if(k>n)
{
k=k-n;
}
you have to do conditions like :
if (k!=n){
k=k%n;
k=n-k;
and call your function append ;
}
call print here //