Bizongo | Software Engineer 1 | 10 December
Question · Posted Apr 2020
Given a linked list, reverse left half and right half independently. If odd length, middle element should remain as it is. Input = 1 -> 2 -> 3 -> 4 -> 5 -> 6 Output = 3 -> 2 -> 1 -> 6 -> 5 -> 4
The full answer & interview discussion are available to premium members.
Log in Create a free account