Tap here to switch tabs
Problem
Submissions

Problem: Remove Trailing Zeros From a String

med
30 min
Try to solve the Remove Trailing Zeros From a String problem.

Statement

Given a string num representing a positive integer, return the string num after removing all of its trailing zeros.

Constraints:

  • 1≤1 \leq num.length ≤1000\leq 1000

  • num consists only of digits.

  • num does not have any leading zeros.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Remove Trailing Zeros From a String

med
30 min
Try to solve the Remove Trailing Zeros From a String problem.

Statement

Given a string num representing a positive integer, return the string num after removing all of its trailing zeros.

Constraints:

  • 1≤1 \leq num.length ≤1000\leq 1000

  • num consists only of digits.

  • num does not have any leading zeros.