Stefan Mahlitz <stefan / mahlitz-net.de> writes: > I really do > not need the value of any stored key. Right. > Why use a Hash? Efficiency. Array#include? runs in linear time (i.e. the running time is proportional to the size of the array because all elements have to be tested sequentially), while Hash#[] runs in constant time (i.e. the running time is independent of the size of the hash). So the array-based solution will scale very badly for large numbers.