Get Alphabetically Smallest String

Problem Overview

  • Return the alphabetically smallest string by removing exactly one letter from a given string S.
  • Input: lowercase string S of length N; Output: the resulting string; Constraints: N in [2..100000], characters a–z only.
  • Domain: string manipulation and text processing where lexicographic order matters, such as ranking or normalization.
  • This interview question from Microsoft interviews is a classic coding interview problem.

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Input Variables
Execution Result: