Solution to Array to hash