Algorithms on Parenthesis. Catalan Numbers.

There are a few interesting questions I came across recently related to parenthesis.

These gave me interesting insights into a range of algorithms. Also, gave me insight into Catalan Numbers.

Questions:

 

References:

Code: