• + 0 comments

    C++ Solution:

    int connectingTowns(int n, vector<int> routes) {
        
        int result = 1;
        long modulo = 1234567;
        
        for(int i = 0; i < n-1; i++)
        {
            result *= routes[i];
            result %= modulo;
        }
        
        return result;
    }