[Java] solution
\nclass Solution {\n    public List<Integer> mostVisited(int n, int[] rounds) {\n        int length = rounds.length;\n        int start = rounds[0];\n        in
```\nclass Solution {\n    public List<Integer> mostVisited(int n, int[] rounds) {\n        int length = rounds.length;\n        int start = rounds[0];\n        int end = rounds[length-1];\n        List<Integer> result = new ArrayList<>();\n        \n\t\t//case 1: add everything from the round\n        int i = start;\n        if (start <= end) while (i <= end) result.add(i++);\n        //case 2: if end is lesser then we need to add 1 to end and start to n\n\t\telse{\n            i = 1;\n            while (i <= end) result.add(i++);\n            i = start;\n            while (i <= n) result.add(i++);\n        }\n        return result;\n    }\n}\n```
[]