Ad
  • Custom User Avatar

    Also, it says in the instructions that "Each number will....consist of only the digits 0-9" The unknown number cannot be a negative. -1 should be thought of as Out Of Bounds.

  • Custom User Avatar

    The method takes a string as a paramater repressenting the expression and will return an int value representing the unknown rune or -1 if no such rune exists.

    It expects -1 because there is no such rune that satisfy the equality.

  • Custom User Avatar

    I manage to create a specific test case so that you cannot create a huge string that concatenate calls to getChunk().
    Now go ahead and try :)

  • Custom User Avatar

    Hello,

    I think this is gonna help you because I don't clearly understand your problem (and the jsbin code is evolving):

     test3:
      {
        text: "Once upon a time.\n",
        words: 4,
        chars: 17,
        lines: 2
      },
      test4:
      {
        text: "",
        words: 0,
        chars: 0,
        lines: 0
      },
    

    There is currently no test were the text is only "\n". (Although I might add one because my implementation would failed in that case!).

    I guess there is someting wrong in your implementation, likely regarding the word count.

    One important thing: you broke one rule in your implementation: "You cannot concatenete calls to getChunk."
    It's hard for me to test that, maybe I'll with a huge string which cannot fit in memory.
    Please respect that rule, which is the very goal of this exercice: parse by chunks!

    I'll try to provide another object to bypass the "Reader is not defined" issue without breaking existing tests.