Stretch problem

Checkpoint: midpoint mock round

Stretch problem

Untimed, and harder than anything in the rounds. Optional, and worth doing.

The timed rounds measure whether you can produce under pressure. This one measures something else: whether you can stay with a problem that does not yield in ten minutes.

Take as long as you like. Come back to it tomorrow if it stalls. Both skills matter and they are trained differently.

Tip

One structural hint

It combines two things from Unit 8: a postorder recursion that returns a built value rather than a number, and answering many queries about subtrees. Everything else follows from those.

Subtree Postorder Palindromes

For each query, decide whether the postorder label string of that rooted subtree reads the same forward and backward. Building every string separately is the obvious approach; work out what it costs on a deep tree before committing to it.

Loading the workspace…
← Previous