Ad
  • Custom User Avatar

    Your current solution seems to be correct now?

  • Custom User Avatar

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

  • Custom User Avatar

    Why do you think they are invalid? They are not invalid.

  • Custom User Avatar

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

  • Custom User Avatar

    Yeah, I suppose, I got it where the problem is, thanks

  • Custom User Avatar

    Remember that when you are stuck and do not know how to proceed, you can visit the #help-solve channel on Codewars Discord.

  • Custom User Avatar

    You are reading the logs wrong, and the test case which your solution fails is not the one you think it fails. Your solution works correctly for arr1=[121 144 19 161 19 144 19 11] and arr2=[121 14641 20736 36100 25921 361 20736 361] and tests consider your answer correct for this input. Your solution fails for another input, which you did not infer correctly.

    You can debug your solution further after adding these lines at the top of your solution:

      fmt.Printf("a1 %v#\n", array1)
      fmt.Printf("a2 %v#\n", array2)
    

    Then you will see what arrays really are handled incorrectly by your solution.

    Your issue is not a correct one. I am not saying that the kata is not confusing, but this does not change the fact that this issue is caused by wrong interpretation of the error.

  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

    @Chrono79

    Tests Comp
    should handle basic cases
    Expected
        <bool>: false
    to equal
        <bool>: true
    

    The code is below under the spoiler

  • Custom User Avatar

    Your algorithm is obviously very wrong, and you should know that because your reasoning is probably something like "hey maybe this works" and "yeah seems to pass these five tests I tried" and then you promoted that to correct xD

    But that's not why you're failing the tests, they might actually allow your incorrect algorithm. You are mixing up test cases. It doesn't help that the test output is very poor.

  • Custom User Avatar

    You're reading the logs wrong. The test with that input expects false.

        a1 = {121, 144, 19, 161, 19, 144, 19, 11}
        a2 = {11*11, 121*121, 144*144, 190*190, 161*161, 19*19, 144*144, 19*19}
        testing(a1, a2, false)
    

    Not a kata issue.

  • Custom User Avatar
  • Custom User Avatar

    There is an invalid test case in the golang version (basic cases):

    arr1=[121 144 19 161 19 144 19 11]
    arr2=[121 14641 20736 36100 25921 361 20736 361]
    

    The test with these input parameters expects the function to return true. However, the second array has an invalid value: instead of 36100, the array should contain 361 to expect true

    arr1=[19]
    arr2=[36100]
    

    The correct code cannot pass the tests because of this

  • Custom User Avatar
  • Loading more items...