2
\$\begingroup\$

For example, given 3 sets of parenthesis, you have:

()()() ((())) ()(()) (())() (()()) 

= 5 possible combinations.

Challenge

Program must:

• Take 1 number as an input

• Return one output, the number of possible combinations of parenthesis sets

Shortest number of bytes wins

\$\endgroup\$
7
  • 1
    \$\begingroup\$ Welcome to Code Golf and nice first question! For future reference, we recommend using the Sandbox to get feedback on challenge ideas before posting them to main. I'd recommend you explain what a "valid" parenthesis set is. Check out some of the questions in the balanced-string tag for some good definitions \$\endgroup\$ Commented Mar 16, 2021 at 21:21
  • 2
    \$\begingroup\$ Is this a duplicate of this challenge? \$\endgroup\$ Commented Mar 16, 2021 at 21:39
  • 2
    \$\begingroup\$ Is this a duplicate of Catalan Numbers? \$\endgroup\$ Commented Mar 16, 2021 at 21:39
  • 3
    \$\begingroup\$ Heh, ninja'd in a comment, that's another level. \$\endgroup\$ Commented Mar 16, 2021 at 21:40
  • 1
    \$\begingroup\$ @Arnauld we have a restricted version - Parentheses sequences in lexicographical order. \$\endgroup\$ Commented Mar 16, 2021 at 22:13

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.