hackerrank/interview_preparation_kit_warm_up_challenges.rb
# Complete the sockMerchant function below.

Complete the sockMerchant function below.
Complete the sockMerchant function below .
def sockMerchant(n, ar)
  ar.group_by {|b| b}
    .values
    .map {|b| b.size/2}
    .sum
end
def sockMerchant ( n , ar ) ar . group_by { | b | b } . values . map { | b | b . size / 2 } . sum end
Complete the sockMerchant function below.
Complete the sockMerchant function below .
n
<not_specific>
ar
<not_specific>