findmode-nonlocal-state-pattern

Status: IN

`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.

Source: entries/2026/06/06/find-mode-in-binary-search-tree-solution.md

JSON