728. Self Dividing Numbers Easy

@problem@discussion
#Math



1/**
2 * [728] Self Dividing Numbers
3 *
4 * A self-dividing number is a number that is divisible by every digit it contains.
5 * 
6 * 	For example, 128 is a self-dividing number because 128 % 1 == 0, 128 % 2 == 0, and 128 % 8 == 0.
7 * 
8 * A self-dividing number is not allowed to contain the digit zero.
9 * Given two integers left and right, return a list of all the self-dividing numbers in the range [left, right].
10 *  
11 * Example 1:
12 * Input: left = 1, right = 22
13 * Output: [1,2,3,4,5,6,7,8,9,11,12,15,22]
14 * Example 2:
15 * Input: left = 47, right = 85
16 * Output: [48,55,66,77]
17 *  
18 * Constraints:
19 * 
20 * 	1 <= left <= right <= 10^4
21 * 
22 */
23pub struct Solution {}
24
25// problem: https://leetcode.com/problems/self-dividing-numbers/
26// discuss: https://leetcode.com/problems/self-dividing-numbers/discuss/?currentPage=1&orderBy=most_votes&query=
27
28// submission codes start here
29
30impl Solution {
31    pub fn self_dividing_numbers(left: i32, right: i32) -> Vec<i32> {
32        vec![]
33    }
34}
35
36// submission codes end
37
38#[cfg(test)]
39mod tests {
40    use super::*;
41
42    #[test]
43    fn test_728() {
44    }
45}
46


Back
© 2025 bowen.ge All Rights Reserved.