K reverse code problem


this code is showing tle.please help.

u are taking input K in buildList function but then u are not using it

the K factor has to be used to create groups of k and then reverse them
do something like

image image

also in print function cout << temp->data <<" ";
and not temp->next


It shows a warning and then does not compile.

image


check out this code