Ad
  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    That can't be true. I, for example, have this test

    assert.strictEqual(woofDecoder("Shhh! Shhh-shhh!"), "nothing to decode!");
    

    To make sure, I added this in my test cases

      it("given \"Woof-shhh-woofwoof!\"", function() {
      assert.strictEqual(woofDecoder("Woof-shhh-woofwoof!"), "b");
      });
    

    Random tests can generate woofless subsequences too

    Is it now resolved?

  • Default User Avatar

    Considering each subsquence one woof (even if it doesn't contain a woof) wouldn't get you through the tests. If I understood you wrong, please clarify

  • Default User Avatar

    I changed the beginning of the third item in the "things to keep in mind" list to

    1. Sequences consist of hyphen-separated subsequences. Each subsequence can contain either zero or one woof (which, in turn, represents zero or one step in the alphabet traversing).

    Also, I highlighted the word "letters" in bold while making some minor edits to make the meaning clearer

    1. Justin's audio recorder is not a very good one. Sometimes, it inserts some random sounds that should be ignored. With that in mind, a woof is any string of letters that has a "w", an "o", another "o", and an "f" – in that order but not necessarily consecutively and irrespective of the case. If an input string has no woofs, the function should return "nothing to decode!"

    You can re-raise (hopefully, providing additional clarifications) in case you deem it insufficient

  • Default User Avatar

    Do you think it's unclear? How do you think I can improve it?

    Each woof subsequence can contain either zero or one woof (which, in turn, represents zero or one step in the alphabet traversing). For example, in a woof sequence "Woof-shhh-woofwoof!" there are three subsequences: "Woof", "shhh", and "woofwoof". The first one contains a woof, the second one doesn't, the third one also has a woof (not two). It means this woof sequence of two woofs in total stands for "b"

    also

    a woof is any sequence of letters

    The expected output of your example string is nothing to decode! since neither of the subsequences (which are: 'w', 'o', 'o', and 'f') contains a woof

  • Default User Avatar

    Fixed

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    Again, why does that happen under such circumstances?

  • Default User Avatar

    Why didn't you like my fix?

  • Default User Avatar

    Why do you think that happens when you generate a random number as a stop condition on every iteration?

  • Default User Avatar

    Ok. I replaced "of" with "with" so I don't think there's any ambiguity left

  • Default User Avatar

    Could you expand on that with some examples?

  • Default User Avatar

    Ok

  • Default User Avatar

    Ok

  • Default User Avatar

    Why would that result in a distribution heavily biased towards the bottom of the range?

  • Loading more items...