We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
defcountApplesAndOranges(s,t,a,b,apples,oranges):# Write your code here#finding apples fall in house areacount_apple_house=filter(lambdaapple:a+apple>=sanda+apple<=t,apples)print(len(list(count_apple_house)))#finding oranges fall in house areacount_orange_house=filter(lambdaorange:b+orange>=sandb+orange<=t,oranges)print(len(list(count_orange_house)))
Cookie support is required to access HackerRank
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 →