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

    In the test cases there is ['19--45=5?', -1]. So if I understand correctly the expressions is : 19 - (-45) = 5(-1) ?? The result should be 64 no? Also don't know how the missing number could be a negative number when the number its missing from is positive?

  • Custom User Avatar

    Interesting Kata. Though I can't figure from where do I get the original array paramaters from? from inside my pipe method, I have 'this' and my one argument which is the second funciton to pipe to, my problem is I have no way (that I know of) to access the original array params following the format of: [1,2,3,4].map(addOne(pipe(square)); How does the initial addOne even receive the iterated array paramater? Any help would be appreciated

  • 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

    Bug still here, I've updated the default test cases to workaround this issue.

  • Custom User Avatar

    I've updated the test cases with a FileReaderSimulator to bypass the "ReferenceError: Reader is not defined" error when testing.
    Note: this is a codewars bug and even though the staff is hyper reactive, bug is still here...

  • 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.

  • Custom User Avatar

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