Remove Zeros in Decimal Representation gives you a positive integer and asks you to return the number formed after deleting every zero from its decimal digits.
Statement
Given a positive integer n, remove all occurrences of the digit 0 from its decimal representation and return the resulting integer.
Constraints:
1≤n≤1015
Examples
Fetching Slides...
Understand the problem
Now, let’s take a moment to make sure you’ve correctly understood the problem. The quiz below helps you check if you’re solving the correct problem:
Remove Zeros in Decimal Representation
1.
After removing every digit (0) from the decimal representation of 1000000000000000, what integer is returned?
A.
(1000000000000000)
B.
(1)
C.
(10)
D.
(100000000000000)
1 / 5
Figure it out!
We have a game for you to play. Rearrange the logical building blocks to develop a clearer understanding of how to solve this problem.
Sequence - Vertical
Drag and drop the cards to rearrange them in the correct sequence
1
2
3
4
5
Try it yourself
Implement your solution in the following coding playground.
Remove Zeros in Decimal Representation gives you a positive integer and asks you to return the number formed after deleting every zero from its decimal digits.
Statement
Given a positive integer n, remove all occurrences of the digit 0 from its decimal representation and return the resulting integer.
Constraints:
1≤n≤1015
Examples
Fetching Slides...
Understand the problem
Now, let’s take a moment to make sure you’ve correctly understood the problem. The quiz below helps you check if you’re solving the correct problem:
Remove Zeros in Decimal Representation
1.
After removing every digit (0) from the decimal representation of 1000000000000000, what integer is returned?
A.
(1000000000000000)
B.
(1)
C.
(10)
D.
(100000000000000)
1 / 5
Figure it out!
We have a game for you to play. Rearrange the logical building blocks to develop a clearer understanding of how to solve this problem.
Sequence - Vertical
Drag and drop the cards to rearrange them in the correct sequence
1
2
3
4
5
Try it yourself
Implement your solution in the following coding playground.