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.
Apple and Orange
Apple and Orange
Sort by
recency
|
3130 Discussions
|
Please Login in order to post a comment
Mi solucion en C# con bucle y LINQ
Mi solución en Python 3:
def countApplesAndOranges(s, t, a, b, apples, oranges): line1 = 0 line2 = 0
co=0 for i in apples : if(i+a)>=s and (i+a)<=t: ca+=1 for i in oranges : if(i+b)>=s and (i+b)<=t: co+=1 print(ca) print(co)
co=0 for i in apples : if(i+a)>=s and (i+a)<=t: ca+=1 for i in oranges : if(i+b)>=s and (i+b)<=t: co+=1 print(ca) print(co)