TweakCode
Recursion lessons
Loading editor…
Test casesRun to compare output
Input
ops = ["KthLargest","add","add","add","add","add"], args = [[3,[4,5,8,2]],[3],[5],[10],[9],[4]]
Output
—
Expected
[null,4,5,5,8,8]

More practice

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