#C7108. Smallest Number After Deleting One Digit
Smallest Number After Deleting One Digit
Smallest Number After Deleting One Digit
You are given a positive integer \(N\). Your task is to remove exactly one digit from the decimal representation of \(N\) so that the remaining number (when interpreted as an integer) is as small as possible.
For example, if \(N = 635\), removing the digit '6' results in 35, removing '3' gives 65 and removing '5' gives 63. Therefore, the smallest possible number is 35.
Note: When a digit is removed, the remaining digits retain their order, and any leading zeros in the result are ignored. For instance, deleting a digit from "400" might yield "00" which is interpreted as 0.
The input may contain multiple test cases. You should process each test case independently.
inputFormat
The first line of input contains a single integer \(T\) (\(T \ge 1\)) representing the number of test cases. Each of the following \(T\) lines contains one positive integer \(N\).
Example:
3 635 89 1029
outputFormat
For each test case, output a single line containing the smallest possible number obtained after deleting exactly one digit from \(N\).
Example:
35 8 29## sample
3
635
89
1029
35
8
29
</p>