I have passed 3 test cases. Can you please give me some hint, what went wrong with my code!!!
K Append Problem - Only 3 test cases passed
I did that in main(). Any other cases!
Can you give a look at my code?
@Kinjal that logic is incorrect. you need to do k = k % n in order to find the effective value of k, in case k > n.
And, what about the cases when k==n and k==0.
What I think that when k==n, then I will just print the list as it is. Right!!!
And, when k==0, then I will include it in the case when k<=n. Right!!!
@Kinjal when k == 0 (check this condition after you compute k = k % n), you dont need to make any changes at all to the list so you can simply return the current list as it is. To answer your question, yes it is to be considered in the k <=n case.
So, I have done as you said, tho I got run error in one test case. What went wrong!!! Can you please give a look?
@Kinjal i have made some changes to your code you can see them here https://ide.codingblocks.com/s/212583
I did it in this way. And it passed all the test cases. So we forgot consider the condition (count==k), individually.
Thanks for your help.
@Kinjal this is why i told you to check the condition after computing k = k % n, because if k = n then k would automatically become 0.