[Beats 99%] 差分数组   No tricky
\nclass Solution {\n    int n;\n    int[] a;\n    public List<Integer> mostVisited(int n, int[] rounds) {\n        this.n = n;\n        a = new int[n + 2];\n   
```\nclass Solution {\n    int n;\n    int[] a;\n    public List<Integer> mostVisited(int n, int[] rounds) {\n        this.n = n;\n        a = new int[n + 2];\n        int s = rounds[0];\n        for (int i = 1; i < rounds.length; i++) {\n            add(s, rounds[i]);\n            s = rounds[i] + 1;\n        }\n        int max = 0;\n        for (int i = 1; i <= n; i++) {\n            a[i] += a[i - 1];\n            max = Math.max(max, a[i]);\n        }\n        List<Integer> res = new ArrayList<>();\n        for (int i = 1; i <= n; i++) {\n            if (a[i] == max) res.add(i);\n        }\n        return res;\n    }\n    private void add(int x, int y) {\n        if (x <= y) {\n            a[x]++; a[y + 1]--;\n        } else {\n            a[x]++; a[n + 1]--;\n            a[1]++; a[y + 1]--;\n        }\n    }\n}\n```
[]