Runtime error in my code

cannot find the issue in my code it’s giving runtime error

@roushanraj395
hello roshan,
u r not taking k at runtime.

@roushanraj395
also
image
in place of newhead in highlighted part it should be tail of the list (the list ur constructing)

@roushanraj395
check ur updated code here