6. Nested
map[string]map[string]int
map[rune]map[string]int
map[int]map[string]map[string]intAssignment
billy
billy
bob
joeb: {
billy: 2,
bob: 1
},
j: {
joe: 1
}Solution
Breaking It Down
Step 1: Create the Outer Map
Step 2: Loop Through Names
Step 3: Get the First Character
Step 4: Check If Inner Map Exists
Step 5: Increment the Count
Complete Solution (again for convenience)
Step-by-Step Trace
Why Check if result[firstChar] == nil?
if result[firstChar] == nil?