Ad
  • Default User Avatar

    It is a question not an issue. The tests are the same in all languages and 6749 guys passed the kata.

  • Custom User Avatar

    In my solution, I test these conditions at the top but it still does not pass the test cases when length of a and b are 0. It should return false but my code is returning true.

    if((a==null) || (b==null))
    {
      return false;
    }
    else if(a.length==0 || b.length==0)
    {
      return false;
    }
    else if(a.length != b.length)
    {
      return false;
    }
    

    I tried everything but can not resolve the issue. I post the whole code if you want.

  • Custom User Avatar

    Please read further starting from "However, the standard does not specify how long that "time unit" is".

  • Custom User Avatar

    Kata description says - ""Dash" – is 3 time units long.". This is the rule I am following.

  • Custom User Avatar

    Please read the kata description carefully: "if you have trouble discerning if the particular sequence of 1's is a dot or a dash, assume it's a dot".
    In this particular case you have no way to find out if 111 is a dot or a dash, so assume it's a dot.

  • Default User Avatar

    I can only repeat what I said some time ago about Java

    System.out.println the input (or the size of the given arrays) and your result, then compare that with what the test outputs (note that here in Java tests "actual" and "expected" are swapped but with your output printed you will be able to see what is wrong in your program; it is somehow kind of debugging).
    Note that something is wrong in your code otherwise you would not fail but don't give up!!! Cheers!

  • Custom User Avatar

    For One of the test Case I get this error message. Before Expected I prited out passed bits string. Converted code and than string from morse code.I think output I am getting is correct. Code for - is T and for . is E. Doesn't than mean this test case is broken.
    testExtraZerosHandling(MorseCodeDecoderTest)
    01110

    Letter j is - code for it is T

    Expected: is "E"
    but: was "T"

  • Custom User Avatar

    I had the same issue with my java program. But I successfully improved the performance. You need to make sure that you don't brute force throught the nested loops inside the sumin and sumax. If you look at the table given in question you will see a pattern in the occurence of number for both min and max.

  • Custom User Avatar

    My solution passes all the cases in submit but failing for test case number 4. It gives the error message "expected false but find true". I think the array size for that case is 0. I have that if condition in my code and by printing out I know it goes inside the condition and returns false. I am not getting what is the problem. Can somebody help on this? I am using java programming language.

  • Custom User Avatar
  • Default User Avatar

    how can i print my input and output? i am using javascript.

  • Custom User Avatar

    Please which language? Print your input and your output in your console so you will be able to see your error.

  • Custom User Avatar

    I getting following error in test 2 and 4:

    expected: but was:

    I don't understand the error.