Skip to content

Commit d8ca070

Browse files
add skeleton for 1291
1 parent 35dfce8 commit d8ca070

File tree

3 files changed

+55
-0
lines changed

3 files changed

+55
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ _If you like this project, please leave me a star._ ★
4242
|1297|[Maximum Number of Occurrences of a Substring](https://leetcode.com/problems/maximum-number-of-occurrences-of-a-substring/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1297.java) | |Medium||
4343
|1296|[Divide Array in Sets of K Consecutive Numbers](https://leetcode.com/problems/divide-array-in-sets-of-k-consecutive-numbers/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1296.java) | |Medium||
4444
|1295|[Find Numbers with Even Number of Digits](https://leetcode.com/problems/find-numbers-with-even-number-of-digits/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1295.java) | [:tv:](https://youtu.be/HRp8mNJvLZ0) |Easy||
45+
|1291|[Sequential Digits](https://leetcode.com/problems/sequential-digits/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1291.java) | |Medium||
4546
|1290|[Convert Binary Number in a Linked List to Integer](https://leetcode.com/problems/convert-binary-number-in-a-linked-list-to-integer/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1290.java) | |Easy||
4647
|1287|[Element Appearing More Than 25% In Sorted Array](https://leetcode.com/problems/element-appearing-more-than-25-in-sorted-array/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1287.java) | [:tv:](https://youtu.be/G74W8v2yVjY) |Easy||
4748
|1286|[Iterator for Combination](https://leetcode.com/problems/iterator-for-combination/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1286.java) | |Medium|Backtracking, Design|
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package com.fishercoder.solutions;
2+
3+
import java.util.List;
4+
5+
/**
6+
* 1291. Sequential Digits
7+
*
8+
* An integer has sequential digits if and only if each digit in the number is one more than the previous digit.
9+
* Return a sorted list of all the integers in the range [low, high] inclusive that have sequential digits.
10+
*
11+
* Example 1:
12+
* Input: low = 100, high = 300
13+
* Output: [123,234]
14+
*
15+
* Example 2:
16+
* Input: low = 1000, high = 13000
17+
* Output: [1234,2345,3456,4567,5678,6789,12345]
18+
*
19+
* Constraints:
20+
* 10 <= low <= high <= 10^9
21+
* */
22+
public class _1291 {
23+
public static class Solution1 {
24+
public List<Integer> sequentialDigits(int low, int high) {
25+
//TODO: implement it
26+
return null;
27+
}
28+
}
29+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package com.fishercoder;
2+
3+
import com.fishercoder.solutions._1291;
4+
import org.junit.BeforeClass;
5+
import org.junit.Ignore;
6+
import org.junit.Test;
7+
8+
import java.util.Arrays;
9+
10+
import static org.junit.Assert.assertEquals;
11+
12+
@Ignore
13+
public class _1291Test {
14+
private static _1291.Solution1 solution1;
15+
16+
@BeforeClass
17+
public static void setup() {
18+
solution1 = new _1291.Solution1();
19+
}
20+
21+
@Test
22+
public void test1() {
23+
assertEquals(Arrays.asList(), solution1.sequentialDigits(100, 300));
24+
}
25+
}

0 commit comments

Comments
 (0)