3726. Remove Zeros in Decimal Representation Easy

@problem@discussion
#Math#Simulation



1/**
2 * [3726] Remove Zeros in Decimal Representation
3 *
4 * You are given a positive integer n.
5 * Return the integer obtained by removing all zeros from the decimal representation of n.
6 *  
7 * <strong class="example">Example 1:
8 * <div class="example-block">
9 * Input: <span class="example-io">n = 1020030</span>
10 * Output: <span class="example-io">123</span>
11 * Explanation:
12 * After removing all zeros from 1<u>0</u>2<u>00</u>3<u>0</u>, we get 123.
13 * </div>
14 * <strong class="example">Example 2:
15 * <div class="example-block">
16 * Input: <span class="example-io">n = 1</span>
17 * Output: <span class="example-io">1</span>
18 * Explanation:
19 * 1 has no zero in its decimal representation. Therefore, the answer is 1.
20 * </div>
21 *  
22 * Constraints:
23 * 
24 * 	1 <= n <= 10^15
25 * 
26 */
27pub struct Solution {}
28
29// problem: https://leetcode.com/problems/remove-zeros-in-decimal-representation/
30// discuss: https://leetcode.com/problems/remove-zeros-in-decimal-representation/discuss/?currentPage=1&orderBy=most_votes&query=
31
32// submission codes start here
33
34impl Solution {
35    pub fn remove_zeros(n: i64) -> i64 {
36        
37    }
38}
39
40// submission codes end
41
42#[cfg(test)]
43mod tests {
44    use super::*;
45
46    #[test]
47    fn test_3726() {
48    }
49}
50

Back
© 2026 bowen.ge All Rights Reserved.