Implement rotating a linked list by k groups.