2 ms·
Here's the ruby one-liner: tree = Hash.new { |h, k| h[k] = Hash.new(&h.default_proc) } (explanation is here: http://matthew.mceachen.us/blog/multi-value-has
by mceachen 15y ago
Here's the ruby one-liner:
tree = Hash.new { |h, k| h[k] = Hash.new(&h.default_proc) }
(explanation is here: http://matthew.mceachen.us/blog/multi-value-hashes-in-ruby-1114.html http://matthew.mceachen.us/blog/multi-value-hashes-in-ruby-1...)