In the question its stated that āK can be greater than Nā. What has to be doe in this corner case , its unclear. please let me know about the same.
Also, im not passing all the test cases, could you giv eme a hint about what ik doing wrong.
Link to my current solution: https://ide.codingblocks.com/s/203800
Thanks,
Mayank Kapur
Query regarding the question
means that the size of list that can be appened can be greater than size of the actual input list
since this is not possible that
given linked list size 5
u append a list of size 7
so
u need to do k%=size
7%5 == 2
so u need to append just 2 nodes from the front to extreme back
one u update this condition in int main()
then code would work
give special care for another test case when k == size of linked list
it would give run time error.
try thinking of it by urself
in case u need some help ping me
Okay, got it! Thanks a lot!
1 Like