1291. Sequential Digits Medium

@problem@discussion
#Enumeration



1/**
2 * [1291] Sequential Digits
3 *
4 * An integer has sequential digits if and only if each digit in the number is one more than the previous digit.
5 * Return a sorted list of all the integers in the range [low, high] inclusive that have sequential digits.
6 *  
7 * Example 1:
8 * Input: low = 100, high = 300
9 * Output: [123,234]
10 * Example 2:
11 * Input: low = 1000, high = 13000
12 * Output: [1234,2345,3456,4567,5678,6789,12345]
13 *  
14 * Constraints:
15 * 
16 * 	10 <= low <= high <= 10^9
17 * 
18 */
19pub struct Solution {}
20
21// problem: https://leetcode.com/problems/sequential-digits/
22// discuss: https://leetcode.com/problems/sequential-digits/discuss/?currentPage=1&orderBy=most_votes&query=
23
24// submission codes start here
25
26impl Solution {
27    pub fn sequential_digits(low: i32, high: i32) -> Vec<i32> {
28        vec![]
29    }
30}
31
32// submission codes end
33
34#[cfg(test)]
35mod tests {
36    use super::*;
37
38    #[test]
39    fn test_1291() {
40    }
41}
42


Back
© 2025 bowen.ge All Rights Reserved.