You are viewing a single comment's thread. Return to all comments →
def beautifulPairs(a, b) summation = (a & b).map {|e| [a.count(e), b.count(e)].min }.sum (summation < b.length) ? summation + 1 : summation-1 end
Seems like cookies are disabled on this browser, please enable them to open this website
Beautiful Pairs
You are viewing a single comment's thread. Return to all comments →
Ruby