You are viewing a single comment's thread. Return to all comments →
Ruby
def countApplesAndOranges(s, t, a, b, apples, oranges) land_on_house = lambda { |value| value.between?(s, t) } puts apples.count {|apple| land_on_house.(apple + a)} puts oranges.count {|orange| land_on_house.(orange + b)} end
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 →
Ruby