about | help | code help+videos | done | prefs |
Write a method that accepts an array of strings. Count how many times the string "who" or "Who" appears in the array, except do not count a "Who" that comes after another "Who" unless there is at least one "who" between them. For example, {"Who", "who", "who", "Who", "Who", "what", "Who"} has 4 whos that count. The last two "Who"s do not count because they came after a "Who" but before another "who". As another example, {"Who", "what", "jump", who", "who", "run", "Who"} has all 4 count, because a "Who" never follows another "Who" until after a "who". owlSayWho([]) → 0 owlSayWho(["who"]) → 1 owlSayWho(["Who"]) → 1 ...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