lol

Code:

Python3

class Solution:
    def removeTrailingZeros(self, num: str) -> str:
        return num.rstrip('0')

Big O Analysis

  • Runtime

    The runtime complexity here is O(N) where N = length of list nums.

  • Memory

    constant space!

— A

GitHub | Twitter