about | help | code help+videos | done | prefs |
Write a method that accepts a string "AND" or "OR" to indicate which logic operation to use, and a string of "T" or "F" characters in any order. Return a string of "T" and "F" characters indicating the result of repeated "AND" or "OR"-ing of the truth values. For example, if the operation is "AND" and the other input parameter is "TTTFTFTTF", the result will be "TTTFFFFFF". Look at the test data for further examples. bbb2truthSoFar("AND", "TFTFT") → "TFFFF" bbb2truthSoFar("OR", "TFTFT") → "TTTTT" bbb2truthSoFar("AND", "TTTFTTFFTF") → "TTTFFFFFFF" ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 290
Copyright Nick Parlante 2017 - privacy