Linklist k append 2 test case fails

https://ide.codingblocks.com/s/57431

Hi Neeraj , I just checked your code . I think there is a lot of redundancy in your code .
The logic behind the question is :-

  1. you just have to traverse till k-1 node from the head node
  2. store that position into some other pointer . Make its next as NULL
  3. Traverse the linked- list from that node till end and attach the head to the end node.
    Here is the code you can go through - https://ide.codingblocks.com/s/57436 .
1 Like

@ashishnagpal2498 thank you so much bhaiya .apericate your support bhaiya

1 Like