TweakCode
Recursion lessons
Loading editor…
Test casesRun to compare output
Input
root = [4,2,7,1,3], val = 2
Output
—
Expected
[2,1,3]

More practice

Same technique, different problems. Try them without the walkthrough.