Class Solution
-
- All Implemented Interfaces:
public final class Solution3726 - Remove Zeros in Decimal Representation.
Easy
You are given a positive integer
n.Return the integer obtained by removing all zeros from the decimal representation of
n.Example 1:
Input: n = 1020030
Output: 123
Explanation:
After removing all zeros from 1**<ins>0</ins>2<ins>00</ins>3<ins>0</ins>** , we get 123.
Example 2:
Input: n = 1
Output: 1
Explanation:
1 has no zero in its decimal representation. Therefore, the answer is 1.
Constraints:
<code>1 <= n <= 10<sup>15</sup></code>
-
-
Constructor Summary
Constructors Constructor Description Solution()
-
Method Summary
Modifier and Type Method Description final LongremoveZeros(Long n)-
-
Method Detail
-
removeZeros
final Long removeZeros(Long n)
-
-
-
-