Longest Continuous Segment with Modifications - Coding problem | OneNoughtOne