#C5842. Smallest Lexicographical String after Removing One Character
Smallest Lexicographical String after Removing One Character
Smallest Lexicographical String after Removing One Character
You are given a non-empty string s consisting of lowercase letters. Your task is to remove exactly one character from the string such that the resulting string is the smallest possible in lexicographical order.
Formally, let \( s = s_0s_1\ldots s_{n-1} \) be a string of length \( n \). For each index \( i \) (\( 0 \leq i < n \)), let the string \( s^{(i)} \) be defined as:
[ s^{(i)} = s_0 s_1 \ldots s_{i-1} s_{i+1} \ldots s_{n-1} ]
Your goal is to choose an index \( i \) such that \( s^{(i)} \) is lexicographically minimal among all choices. Note that when \( s \) is a single-character string, the answer is an empty string.
inputFormat
The input consists of a single non-empty string s provided via stdin. The string will contain only lowercase English letters.
outputFormat
Output the smallest lexicographical string obtained by removing exactly one character from the input string. The output should be printed to stdout.
## sampleabab
aab