solulubeta
Sign in
Story Problems / Arrays, windows & two pointers
01.14 · Problem

Shortest Stretch to Re-sort

Medium Left-right scans (boundaries) Pro

This problem is part of solulu Pro

Students stand in a line by height (ideally increasing). The teacher may pick one continuous section and sort just that section so that the whole line becomes sorted. What is the length of the shortest such section? (0…

Lifetime ₹2,000 ₹1,000 · Beta offer
Mark this problem as solved when you are finished.

Item 14 of 94 · updated 2026-10-12