num of decimal digits with no leading zeros.
Remove all the zeros at the end of it and return the result, also as a string.num='40500' → '405'
The two zeros at the end are cut off; the zero in the middle stays.
num='7' → '7'
There are no trailing zeros, so the string is unchanged.
num.length ≤ 1000num consists of digits onlynum does not start with a zeronum='40500'
'405'
Run checks the first 3 tests in your browser. Submit checks all 23 tests on the server, hidden ones included.