is there a form of Dictionary.updateValue(_:forKey:) that returns the index of the updated/inserted dictionary element?
Dictionary.updateValue(_:forKey:)