On Jan 24, 5:01 pm, "Dorren" <dorrenc... / gmail.com> wrote:
> a little clearer than previous one.
>
>   hash = Hash[*hash.inject([]){|arr, (k, v)|
>                                arr += Array === k ? k.zip([v]* k.size)
> : [k, v]
>                              }.flatten]

Hash[ *hash.map{|k,v| k=[*k]; k.zip([v]*k.size) }.flatten ]