python very easy to understand brute force
\nclass Solution:\n    def mostVisited(self, n: int, rs: List[int]) -> List[int]:\n        l=[]\n        for i in range(1,n+1):\n            l.append(0)\n      
```\nclass Solution:\n    def mostVisited(self, n: int, rs: List[int]) -> List[int]:\n        l=[]\n        for i in range(1,n+1):\n            l.append(0)\n        for i in range(1,len(rs)):\n            f=rs[i-1]\n            s=rs[i]\n            if(f>s):\n                for j in range(f-1,n):\n                    l[j]+=1\n                for j in range(s-1):\n                    l[j]+=1\n            else:    \n                for j in range(f-1,s-1):\n                    l[j]+=1\n            #print(l)\n            print(f,s,l)\n        l[rs[-1]-1]+=1    \n        m=max(l)        \n        ans=[]\n        for i in range(len(l)):\n            if(l[i]==m):\n                ans.append(i+1)\n        ans.sort()        \n        return(ans)        \n            \n            \n```
['Python', 'Python3']