You are viewing a single comment's thread. Return to all comments →
a little bit more verbose
def countApplesAndOranges(s, t, a, b, apples, oranges): apples = [apple+a for apple in apples] oranges = [orange+b for orange in oranges] house = range(s, t+1) print(sum(1 for apple in apples if apple in house)) print(sum(1 for orange in oranges if orange in house ))
Seems like cookies are disabled on this browser, please enable them to open this website
Apple and Orange
You are viewing a single comment's thread. Return to all comments →
a little bit more verbose