2520. Count the Digits That Divide a Number Easy

@problem@discussion
#Math



1/**
2 * [2520] Count the Digits That Divide a Number
3 *
4 * Given an integer num, return the number of digits in num that divide num.
5 * An integer val divides nums if nums % val == 0.
6 *  
7 * Example 1:
8 * 
9 * Input: num = 7
10 * Output: 1
11 * Explanation: 7 divides itself, hence the answer is 1.
12 * 
13 * Example 2:
14 * 
15 * Input: num = 121
16 * Output: 2
17 * Explanation: 121 is divisible by 1, but not 2. Since 1 occurs twice as a digit, we return 2.
18 * 
19 * Example 3:
20 * 
21 * Input: num = 1248
22 * Output: 4
23 * Explanation: 1248 is divisible by all of its digits, hence the answer is 4.
24 * 
25 *  
26 * Constraints:
27 * 
28 * 	1 <= num <= 10^9
29 * 	num does not contain 0 as one of its digits.
30 * 
31 */
32pub struct Solution {}
33
34// problem: https://leetcode.com/problems/count-the-digits-that-divide-a-number/
35// discuss: https://leetcode.com/problems/count-the-digits-that-divide-a-number/discuss/?currentPage=1&orderBy=most_votes&query=
36
37// submission codes start here
38
39impl Solution {
40    pub fn count_digits(num: i32) -> i32 {
41        0
42    }
43}
44
45// submission codes end
46
47#[cfg(test)]
48mod tests {
49    use super::*;
50
51    #[test]
52    fn test_2520() {
53    }
54}
55


Back
© 2025 bowen.ge All Rights Reserved.