Skip to content

[codex] Optimize sum root to leaf numbers#76

Merged
eselyavka merged 1 commit into
masterfrom
codex-optimize-sum-root-to-leaf-numbers
May 22, 2026
Merged

[codex] Optimize sum root to leaf numbers#76
eselyavka merged 1 commit into
masterfrom
codex-optimize-sum-root-to-leaf-numbers

Conversation

@eselyavka
Copy link
Copy Markdown
Owner

Summary

Updates LeetCode 129 to carry the current root-to-leaf value through DFS instead of building string paths or reconstructing paths from parent pointers.

This makes the solution visit each node once and keeps auxiliary space proportional to tree height.

Validation

  • python3 practice/leetcode/solutions_00000/solution_00129.py
  • commit hook: 805 passed in 1.29s
  • commit hook: pylint on changed Python files, 10.00/10

@eselyavka eselyavka marked this pull request as ready for review May 22, 2026 23:08
@eselyavka eselyavka merged commit 112c419 into master May 22, 2026
4 checks passed
@eselyavka eselyavka deleted the codex-optimize-sum-root-to-leaf-numbers branch May 22, 2026 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant