Arrays and collections / Dictionaries

dic = {1 => "A"2 => "B"}
value1 = dic[3]
# value1 is nil
dic.default = "-"
value2 = dic[3]
# value2 is "-"

chars = "ABCBA"
charCounts = Hash.new(0)
chars.each_char do |c|
    charCounts[c] += 1
end
# charCounts is ["C": 1, "B": 2, "A": 2]

puts "value1 is '#{value1}'"
puts "value2 is '#{value2}'"
puts "charCounts is #{charCounts}"