K-Segment List Reversal - Coding problem | OneNoughtOne