Problem 1569 · Hard

Number of Ways to Reorder Array to Get Same BST

The first value fixes the root, and the two sides interleave freely, so the count is a product of binomial coefficients.

Open the interactive visualisation