in reply to Merge hash keys

My interpretation of your question: Look at the keys of the hash in the order of the values of the hash and join the keys (as strings) with overlaps.

Under this assumption the steps are: