Combine keys and values in RUBY -
given hash:
{:a => "123", :b => "345", :c => "678", :d => "910"}
write code generates array combines keys , values. resulting array should be:
["a123", "b345", "c678", "d910"]
i this:
{:a => "123", :b => "345", :c => "678", :d => "910"}.map { |k, v| "#{k}#{v}" } #=> ["a123", "b345", "c678", "d910"]
Comments
Post a Comment