You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Sam's house has an apple tree and an orange tree that yield an abundance of fruit. Using the information given below, determine the number of apples and oranges that land on Sam's house.
def countApplesAndOranges(s, t, a, b, apples, oranges):
print(sum([1 for x in apples if (x + a) >= s and (x + a) <= t]))
print(sum([1 for x in oranges if (x + b) >= s and (x + b) <= t]))