class Solution: def removeTrailingZeros(self, num: str) -> str: val = int(num) while val > 0 and val % 10 == 0: val //= 10 return str(val)