Boolean Parenthesization
easy
1. You are given a boolean expression with symbols T,F, and operators &,|,^ , where T represents True F represents False & represents boolean AND | represents boolean OR ^ represents boolean XOR. 2. You have to find the number of ways in which the expression can be parenthesized so that the value of expression evaluates to true.
Constraints
2 <= length of s1 <= 100 1 <= length of s2 <= 99
Format
Input
Two strings s1 and s2
Output
Check the sample output and question video.
Example
Sample Input
TFT
^&
Sample Output
2
Question Video