Easy C++  DFS solution  || commented
\nclass Solution {\npublic:\n    int minReorder(int n, vector<vector<int>>& connections) {\n        \n        //for every city store the adjacent city along wit
```\nclass Solution {\npublic:\n    int minReorder(int n, vector<vector<int>>& connections) {\n        \n        //for every city store the adjacent city along with direction \n        //to store the direction we use positive indicating a road from a to b for a\n        //we use negative indicating there is a road from b to a for a\n        \n        vector<vector<int>> adjCities(n);\n        vector<bool> visited(n,false);\n        for(int i=0;i<connections.size();i++)\n        {\n            int city1=connections[i][0];\n            int city2=connections[i][1];\n            adjCities[city1].push_back(city2);\n            adjCities[city2].push_back(-city1);\n        }\n        \n        //start dfs from city  0 \n        //when ever you found a positive then it need to be reversed\n        int count=0;\n        reorderPaths(0,adjCities,count,visited);\n        return count;\n\n    }\n    void reorderPaths(int currCity,vector<vector<int>>& adjCities,int& count,vector<bool>& visited)\n    {\n        visited[currCity]=true;\n        for(auto city:adjCities[currCity])\n        {\n            \n            if(!visited[abs(city)])\n            {\n                if(city>0) //reorder the path \n                    count++;\n                reorderPaths(abs(city),adjCities,count,visited);\n            }\n        }\n    }\n};\n```\n**Upvote if this helps you :)**
['C']