{"id":"findmode-nonlocal-state-pattern","text":"`findMode` uses `nonlocal` to share four mutable variables (`modes`, `max_count`, `cur_count`, `prev`) between the outer function and the `inorder` closure, avoiding parameter threading.","truth_value":"IN","source":"entries/2026/06/06/find-mode-in-binary-search-tree-solution.md","source_url":"","source_hash":"","justifications":[],"dependents":[],"metadata":{},"created_at":"","updated_at":"","reviewed_at":"","verified_at":"","retracted_at":"","explanation":{"steps":[{"node":"findmode-nonlocal-state-pattern","truth_value":"IN","reason":"premise"}]}}