Skip to main content

Bracket Counts

Challenge on lesson: Checkpoint — Catalan Counts

CHALLENGE
Difficulty: advanced+25 XP

**Problem.** Line 1: q. Each line: n. Print the number of balanced sequences of n bracket pairs mod 1e9+7. **Constraints:** 1 ≤ q ≤ 100; 1 ≤ n ≤ 500000. The W reports C(2n, n) — plausible, wrong for every n > 1.

Back to lesson: Checkpoint — Catalan Counts