Tuesday common C++ interview problem: Number of reorders of a serialized BST.
Given a permutation of 1..N as std::vector<int>, return the number of other permutations that produce the same BST. The BST is produced by inserting elements in the order of their indexes (i.e. left-to-right).
Return the result as modulo 10^9+7.
Solve it yourself: https://compiler-explorer.com/z/aPjrnoafP
Solution: https://compiler-explorer.com/z/shvje5T8j