3 kyu
The boolean order
495 of 1,382KenKamau
Description:
In this Kata, you will be given boolean values and boolean operators. Your task will be to return the number of arrangements that evaluate to True
.
t,f
will stand for true, false
and the operators will be Boolean AND (&), OR (|), and XOR (^)
.
For example, solve("tft","^&") = 2
, as follows:
"((t ^ f) & t)" = True
"(t ^ (f & t))" = True
Notice that the order of the boolean values and operators does not change. What changes is the position of braces.
More examples in the test cases.
Good luck!
Strings
Algorithms
Similar Kata:
Stats:
Created | Oct 21, 2017 |
Published | Oct 21, 2017 |
Warriors Trained | 13430 |
Total Skips | 3672 |
Total Code Submissions | 7449 |
Total Times Completed | 1382 |
JavaScript Completions | 359 |
Python Completions | 495 |
Java Completions | 210 |
Ruby Completions | 42 |
C++ Completions | 212 |
C# Completions | 87 |
Scala Completions | 24 |
Total Stars | 558 |
% of votes with a positive feedback rating | 93% of 171 |
Total "Very Satisfied" Votes | 152 |
Total "Somewhat Satisfied" Votes | 14 |
Total "Not Satisfied" Votes | 5 |
Total Rank Assessments | 3 |
Average Assessed Rank | 4 kyu |
Highest Assessed Rank | 3 kyu |
Lowest Assessed Rank | 6 kyu |