Infosys Interview Question

reverse linked list in k groups