Palindrome bracket sequence count

Share a malignant sign-in question. Insert picture description here
Input:
2
0
1
,
Output:
1
0

Idea : Core:
90% of people who understand the question think that "()" is a sequence of palindrome brackets.
First, if it is a sequence of parentheses, then n must be an even number, and the parenthesis form is either ()() one group after another, or (()) matryoshka form, but both of these conform to the definition of palindrome.
So except for n==1, n is other numbers and the result is 0.

Guess you like

Origin blog.csdn.net/m0_53688600/article/details/114050743