Problem with the code

@jindaldivish check the input format, first you have to take input for n, k and then you have to input the list. you are not taking input in correct order.

will you please provide the corrected code given in the link

@jindaldivish its a quite simple thing, you can manage on your own. Just change the order of the input.
first take input n and then k
and then take n elements as input and put them in a linked list