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 hereres_apple,res_orange=0,0foriinrange(len(apples)):if(apples[i]>0):sum=apples[i]+aif(sum>=sandsum<=t):res_apple+=1foriinrange(len(oranges)):if(oranges[i]<0):sum=oranges[i]+bif(sum<=tandsum>=s):res_orange+=1print(res_apple)print(res_orange)
Mail: mst29310@gmail.com
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 →
Python3 Solution (Easy)
Mail: mst29310@gmail.com