1682. Most Visited Sector in a Circular Track
My accepted Python solution to LeetCode problem 1682, Most Visited Sector in a Circular Track, running in 0ms.
- Difficulty: Easy
- Python
- Runtime 0ms
- Memory 17.5MB
- Updated
Read the problem on LeetCode View on GitHub
The problem statement is LeetCode’s and stays on their site. What follows is my accepted solution.
Python
Accepted on LeetCode — runtime 0ms, memory 17.5MB, accepted 2025-12-30.
class Solution:
def mostVisited(self, n: int, rounds: List[int]) -> List[int]:
start, end = rounds[0], rounds[-1]
if start <= end:
return list(range(start, end + 1))
else:
return list(range(1, end + 1)) + list(range(start, n + 1))