#K33592. Smallest Number by Removing One Digit
Smallest Number by Removing One Digit
Smallest Number by Removing One Digit
Given a string consisting solely of digits ('0'-'9'), you are allowed to remove at most one digit in order to form the smallest possible number. The removal should be done such that the resulting number is minimized. If no removal makes the number smaller, then remove the rightmost digit. For example, for the input (15243), removing the digit '5' produces (1243), which is the smallest possible result.
inputFormat
Input is provided as a single line from standard input containing a non-empty string of digits.
outputFormat
Output the smallest number (as a string) obtained by removing at most one digit from the input. The result should be printed to standard output.## sample
15243
1243