Try to refer to the documentation. If you have Ruby installed in
Windows by Ruby Installer you should have a folder with a *.chm file
with documentation. Other way there is the online Ruby API
documentation, google it.
But that does not make sense because the whole point of the default
value of a Hash is that the key does not need to be there to return the
default value when queried.
There also seems a more fundamental issue: “answer” goes nowhere, it is
not returned. But if one takes these two points together, then there is
really nothing left which justifies a method:
def solution(keys, default_value)
Hash.new(default_value)
end
That method is basically superfluous and can be replaced by the single
line it contains.