← All problemsSign in

3726. Remove Zeros in Decimal Representation

LeetCodeMathSimulationOpen on judge ↗

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 1020030, 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: - 1 <= n <= 1015

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start