JobsJob TrackerJob alerts

Directi ยท 111 questions

All 111Coding 99System Design 3Low-Level Design 3
  • Blueberry Cheese Cake distributionCoding
  • Poor Valet car parking arrangementCoding
  • XML ValidatorCoding
  • Optimal Substring Reversal for Lexicographical MinimizationCoding
  • Query Object PropertiesCoding
  • Max sum of two non-overlapping K-length subarraysCoding
  • Count subarrays with median >= kCoding
  • Design BookMyShowLow-Level Design
  • Find valid T and S combinations for a tennis gameCoding
  • Design a chat messenger with message ordering constraintsSystem Design
  • Advertisement logic for maximum profitCoding
โ† Directi questions
  1. Interview questions
  2. Directi
  3. Optimal Substring Reversal for Lexicographical Minimization
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

  • Find maximum sum of path between any two leaf nodes in a binary tree
  • 0-1 Knapsack maximum profit
  • Maximum area of rectangle of 1s in a modified matrix
  • Count valid letter-mapping keys for word ciphers
  • Largest triangle with different vertex colors on a grid
โ† XML ValidatorQuery Object Properties โ†’

Collected from public candidate posts and coding forums. Updated Nov 2026.