Skip to content

Commit a96ce7f

Browse files
Create 1291.py
1 parent 41ac4e1 commit a96ce7f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

1001-1500/1291.py

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class Solution:
2+
def sequentialDigits(self, low: int, high: int) -> List[int]:
3+
x = "123456789"
4+
ans = []
5+
6+
for i in range(len(x)):
7+
for j in range(i + 1, len(x) + 1):
8+
curr = int(x[i:j])
9+
if low <= curr <= high:
10+
ans.append(curr)
11+
return sorted(ans)

0 commit comments

Comments
 (0)