def solve2(buses, depart):
    'Find the smallest timestamp, such that all the <buses> follow their\n    bus ID, which is indexically paired with <depart>.\n\n    Here I used the Chinese Remainder Theorem, someone well acquainted to\n    anyone who does competitive or discrete mathematics.  '
    mods = [((b - d) % b) for (b, d) in zip(buses, depart)]
    cross_mul = [(product(buses) // b) for b in buses]
    return (sum([((c * pow(c, (- 1), b)) * m) for (b, c, m) in zip(buses, cross_mul, mods)]) % product(buses))
Find the smallest timestamp, such that all the <buses> follow their
bus ID, which is indexically paired with <depart>.

Here I used the Chinese Remainder Theorem, someone well acquainted to
anyone who does competitive or discrete mathematics.
def solve2(buses, depart):
    'Find the smallest timestamp, such that all the <buses> follow their\n    bus ID, which is indexically paired with <depart>.\n\n    Here I used the Chinese Remainder Theorem, someone well acquainted to\n    anyone who does competitive or discrete mathematics.  '
    mods = [((b - d) % b) for (b, d) in zip(buses, depart)]
    cross_mul = [(product(buses) // b) for b in buses]
    return (sum([((c * pow(c, (- 1), b)) * m) for (b, c, m) in zip(buses, cross_mul, mods)]) % product(buses))