Problem 4007 · Medium

Widest Possible Fence

For each candidate height, use originals of that height alone and pair up the rest into matching sums; keep the candidate with the most planks.

Open the interactive visualisation