Parenthesis
CodeChefOpen on judge ↗
The captain of TITANIC is a mathematics freak. He has recently been given a problem that he is unable to solve. And he has asked your help to solve it. There are n numbers in a given expression. X1 X2 X3 .... Xn What is the number of ways to put parenthesis in the expression. For n=4, the different ways are (((x1.x2).x3).x4) ((x1.x2).(x3.x4)) (x1.((x2.x3).x4)) (x1.(x2.(x3.x4))) ((x1.(x2.x3)).
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start