Skip to content

Commit dea0b83

Browse files
authored
Create most-visited-sector-in-a-circular-track.py
1 parent f9264d6 commit dea0b83

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Time: O(n)
2+
# Space: O(1)
3+
4+
class Solution(object):
5+
def mostVisited(self, n, rounds):
6+
"""
7+
:type n: int
8+
:type rounds: List[int]
9+
:rtype: List[int]
10+
"""
11+
return range(rounds[0], rounds[-1]+1) or \
12+
range(1, rounds[-1]+1) + range(rounds[0], n+1)

0 commit comments

Comments
 (0)