hackerrank/interview_preparation_kit_string_manipulation.rb
# Complete the makeAnagram function below.

Complete the makeAnagram function below.
Complete the makeAnagram function below .
def makeAnagram(a, b)
  dict = Hash.new{0}
  cnt = 0
  a.chars.each {|n| dict[n] += 1}
  b.chars.each {|n| dict[n] -= 1}
  dict.values.each {|v| cnt += v.abs}
  cnt
end
def makeAnagram ( a , b ) dict = Hash . new { 0 } cnt = 0 a . chars . each { | n | dict [ n ] += 1 } b . chars . each { | n | dict [ n ] -= 1 } dict . values . each { | v | cnt += v . abs } cnt end
Complete the makeAnagram function below.
Complete the makeAnagram function below .
a
<not_specific>
b
<not_specific>