comefrom: <doocs>0501.Find Mode in Binary Search Tree_1.py
code: def dfs(root):
      if root is None:
          return
      nonlocal mx, prev, ans, cnt
      dfs(root.left)
      cnt = cnt + 1 if prev == root.val else 1
      if cnt > mx:
          ans = [root.val]
          mx = cnt
      elif cnt == mx:
          ans.append(root.val)
      prev = root.val
      dfs(root.right)
masked: def sample_funcname ( var_1 ) :
      if var_1 is None :
          return
      nonlocal var_2 , var_3 , var_4 , var_5
      var_0 ( var_1.left )
      var_5 = var_5 + 1 if var_3 == var_1.val else 1
      if var_5 > var_2 :
          var_4 = [ var_1.val ]
          var_2 = var_5
      elif var_5 == var_2 :
          var_4.append ( var_1.val )
      var_3 = var_1.val
      var_0 ( var_1.right )
  