Skip to content

Latest commit

 

History

History
14 lines (10 loc) · 430 Bytes

hashes.md

File metadata and controls

14 lines (10 loc) · 430 Bytes

Hashes

Escribe un método hash que reciba un arreglo y retorne un hash a partir del arreglo utilizando el índice de cada elemento del arreglo como llave.

# escribe tu solución acá

puts hash([0, 1, 2, 3]) # {0=>0, 1=>1, 2=>2, 3=>3}
puts hash([34, 925, 322]) # {0=>34, 1=>925, 2=>322}
puts hash(["make", "it", "real"]) # {0=>"make", 1=>"it", 2=>"real"}
puts hash([]) # {}

Ver solución