![](/style/images/good.png)
![](/style/images/bad.png)
Boolean String Value
source link: https://www.techinterview.org/post/3233459765/boolean-string-value/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Tech Interview
A site for technical interview questions, brain teasers, puzzles, quizzles (whatever the heck those are) and other things that make you think!
-
-
Given a string consisting of only 0, 1, A, B, C where
A = AND
B = OR
C = XOR
Calculate the value of the string assuming no order of precedence and evaluation is done from left to right.Examples:
Input :
1A0B1Output : 1
1 AND 0 OR 1 = 1Input :
2
1C1B1B0A0
1A0B1Output :
0
1
-
Proudly powered by WordPress.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK