Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a96ce7f

Browse filesBrowse files
Create 1291.py
1 parent 41ac4e1 commit a96ce7f
Copy full SHA for a96ce7f

File tree

1 file changed

+11
-0
lines changed
Filter options

1 file changed

+11
-0
lines changed

‎1001-1500/1291.py

Copy file name to clipboard
+11Lines changed: 11 additions & 0 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.