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

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

  • 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

    I getting following error in test 2 and 4:

    expected: but was:

    I don't understand the error.