Java solution -> 0 ms
IntuitionApproachComplexity

Time complexity:
O(n)


Space complexity:
O(n)

Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
O(n)

- Space complexity:
O(n)

# Code
```java []
class Solution {
    public List<Integer> mostVisited(int n, int[] rounds) {

        List<Integer> ans = new ArrayList<>();

        int start = rounds[0], end = rounds[rounds.length - 1];
        for (int i = 1; i <= n; i++)
            if (start <= i && i <= end)
                ans.add(i);
            else if (start > end && (i >= start || i <= end))
                ans.add(i);

        return ans;
    }
}
```
['Java']