CodingHard
Optimal Substring Reversal for Lexicographical Minimization
Filed under Directi
The question
Given a string of 'a's and 'b's, find the start and end indices of the single substring to reverse such that the resulting string is lexicographically smallest.
No write-up yet. Related questions below have one.
Related Directi questions
Collected from public candidate posts and coding forums. Updated Nov 2026.