I feel like from 362 to here could be `map.insert_or_update_with(elem, 1, |_, count| *count += 1)`, but I'm not sure.