Boolean Parenthesization

Try First, Check Solution later

1. You should first read the question and watch the question video.
2. Think of a solution approach, then try and submit the question on editor tab.
3. We strongly advise you to watch the solution video for prescribed approach.

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.
Input Format
Two strings s1 and s2
Output Format
Check the sample output and question video.
Question Video
Constraints
2 <= length of s1 <= 100
1 <= length of s2 <= 99
Sample Input
TFT
^&
Sample Output
2


  • Asked in Companies
  • Related Topics






Video Solution

Code Solution

Run
 
Run
Id Name