{ 'B' => { 'C' => 2 ,'G' => 1} # see G's and H's count is 1 Taking G and H's pair only once. C is 2 because C, E and C,F do not make a pair, C comes twice and E and F once 'D' => { 'E' => 1, 'H' => 1, 'F'=>1, } # see H's count is 1 }