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

Stats:

CreatedOct 21, 2017
PublishedOct 21, 2017
Warriors Trained13430
Total Skips3672
Total Code Submissions7449
Total Times Completed1382
JavaScript Completions359
Python Completions495
Java Completions210
Ruby Completions42
C++ Completions212
C# Completions87
Scala Completions24
Total Stars558
% of votes with a positive feedback rating93% of 171
Total "Very Satisfied" Votes152
Total "Somewhat Satisfied" Votes14
Total "Not Satisfied" Votes5
Total Rank Assessments3
Average Assessed Rank
4 kyu
Highest Assessed Rank
3 kyu
Lowest Assessed Rank
6 kyu
Ad
Contributors
  • KenKamau Avatar
  • kazk Avatar
  • Blind4Basics Avatar
  • KataSideKick Avatar
  • ZED.CWT Avatar
  • C-V Avatar
  • hobovsky Avatar
  • oybek Avatar
Ad