write test and solution to count array elements and put in a hash