1259. Handshakes That Don't Cross

You are given an even number of people numPeople standing around a circle. Each person shakes hands with exactly one other person, so there are exactly numPeople / 2 handshakes. Return the number of ways these handshakes can occur such that none of the handshakes cross.

Because the answer can be very large, return it modulo 1000000007.

The answer is the Catalan(numPeople / 2) number. Opening the circle at one person turns the arrangement into a sequence of nested non-crossing pairs, and the first person splits the remaining people into two independent arcs.

Examples
Input: 2
Output: 1
Hints
Related Problems

1259. Handshakes That Don't Cross

You are given an even number of people `numPeople` standing around a circle. Each person shakes hands with exactly one other person, so there are exactly `numPeople / 2` handshakes. Return the number of ways these handshakes can occur such that none of the handshakes cross.