When a dictionary is defined and used within the definition it works as shown below.
class Solution: def maxDepth(self, root): mcnt = {} mcnt[