We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 41ac4e1 commit a96ce7fCopy full SHA for a96ce7f
1001-1500/1291.py
@@ -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