You are viewing a single comment's thread. Return to all comments →
def countApplesAndOranges(s, t, a, b, apples, oranges): apples = [a + i for i in apples] oranges = [b + i for i in oranges] count_app = [1 for x in apples if x in range(s,t+1) ] count_org = [1 for x in oranges if x in range(s,t+1) ] print(sum(count_app)) print(sum(count_org))
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 →
Python 3 solution :