7.9 | Implement Cyclic Right Shift in Linked List | Elements of Programming Interviews in Python EPI

3 years ago
27

NOTE:
Right after the k %= n line, you should also check if k is now equal to 0, if so, return L, since no shifts are required. This would trigger in case of k = 5, n = 5 etc., (5 % 5 == 0).

EPI (Elements of programming interviews in python), Question 7.9

Loading comments...