Codeforces 1272 F Two Bracket Sequences —— bfs+dp

NoSuchKey