Mark As Completed Discussion

Good afternoon! Here's our prompt for today.

Suppose we're given a binary tree, one with several leaves like such:

Get Binary Tree Leaves

We're asked to get all the current leaf values, then delete the leaves. Then we repeat-- we again get the leaf values, and then delete-- proceeding until we're done with the root node.

Get Binary Tree Leaves

How could we implement this in an efficient manner?

Try to solve this here or in Interactive Mode.

How do I practice this challenge?

JAVASCRIPT
OUTPUT
:001 > Cmd/Ctrl-Enter to run, Cmd/Ctrl-/ to comment

Here's how we would solve this problem...

How do I use this guide?