#K10996. Remove Exactly One Digit
Remove Exactly One Digit
Remove Exactly One Digit
Given a string s
consisting of digits, remove exactly one digit from s
such that the resulting number (with the digits remaining in their original order) is as large as possible.
If s
contains only one digit, the output should be an empty string.
Note: The comparison between different candidates is based on their lexicographical order, which is valid since all candidates have the same length after one digit is removed.
inputFormat
The input is read from standard input (stdin) and consists of a single line: a non-empty string s
of digits.
outputFormat
Output to standard output (stdout) the largest number (as a string) that can be formed by removing exactly one digit from s
.## sample
1234
234