[JAVA] Faster than 100%, O(n)
\nclass Solution {\n    public List<Integer> mostVisited(int n, int[] rounds) {\n        var start = rounds[0];\n        var end = rounds[rounds.length - 1];   
```\nclass Solution {\n    public List<Integer> mostVisited(int n, int[] rounds) {\n        var start = rounds[0];\n        var end = rounds[rounds.length - 1];   \n        var res = new ArrayList<Integer>();\n        if (start <= end) {\n            for (int i = start; i <= end; i++) res.add(i);\n        } else {\n            for (int i = 1; i <= end; i++) res.add(i);\n            for (int i = start; i <= n; i++) res.add(i);\n        }\n        return res;\n    }\n}\n```
['Java']