Skip to content

t2#1586

Open
spencerkrebs wants to merge 1 commit into
super30admin:masterfrom
spencerkrebs:master
Open

t2#1586
spencerkrebs wants to merge 1 commit into
super30admin:masterfrom
spencerkrebs:master

Conversation

@spencerkrebs
Copy link
Copy Markdown

No description provided.

@super30admin
Copy link
Copy Markdown
Owner

Construct Binary Tree from Inorder and Postorder Traversal (post-in.py)

Remember: The student's solution is written in Python, while the reference is in C++. Keep that in mind when comparing.

Let's begin.

VERDICT: NEEDS_IMPROVEMENT


Root to Leaf Sum (root-leaf.py)

Strengths:

  • The code is clean and easy to read.
  • The time and space complexity are optimal.
  • The logic is correct.

Areas for improvement:

  • Although not necessary, it's better to avoid using instance variables for recursion accumulation if possible, because it can lead to issues if the same instance is reused. However, in the context of LeetCode, it's acceptable. The alternative recursive method that returns the sum might be more elegant and avoid the use of instance variables.
  • The student has commented out an __init__ method. It's not needed, so it should be removed to keep the code clean.

But these are minor points. The solution is correct.

Final

VERDICT: PASS

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.

3 participants