我想比较两个混杂点以确定哪些值可以匹配。例如:
hash1 = {
"hash1_key_a" => 1,
"hash1_key_b" => 2
}
hash2 = {
"hash2_key_a" => 1,
"hash2_key_b" => 3,
"hash2_key_c" => 4
}
# The method here should display the matching keys & values,
# and then delete them from their hashes. For example:
puts "#{hash1_key_a};#{hash2_key_a};1" # 1 is representing the referral we should
# put in for the value
谁能指引我走正确的方向?