You are viewing a single comment's thread. Return to all comments →
def connectingTowns(n, routes): total= 1 for route in routes: total *= route return total % 1234567 t = int(input()) for _ in range(t): n = int(input().strip()) routes = list(map(int, input().split())) result = connectingTowns(n, routes) print(result)
Seems like cookies are disabled on this browser, please enable them to open this website
Connecting Towns
You are viewing a single comment's thread. Return to all comments →
For Python3 Platform
I wrote the code from scratch just to get more practice