Ad
  • Custom User Avatar

    Stuck exactly on the same test. I wrote the code in Golang. Cannot find the 190 in the a but checking the 36100 within b

  • Default User Avatar

    I having the same issue when the problem is tried with Rust, like I mentioned in my own post. Interestingly, when I tried the same test with Python, the exact same test case expects False.

  • Custom User Avatar

    Which language?, make sure you're not confusing the log of one test with the expected result of another.

  • Default User Avatar

    I guess there is a misunderstanding. The return value with those two arrays should be false, like you pointed out. But the test in the Kata expects true, which is incorrect.

  • Custom User Avatar

    No, the test with those input values expects false. Try printing some text with the input values. You're failing another test.

  • Default User Avatar

    Looks like the one of the tests is not correct, and it fails incorrectly. I wonder how others passed the tests.
    The test in question is this:

    a = [121, 144, 19, 161, 19, 144, 19, 11]

    b = [121, 14641, 20736, 36100, 25921, 361, 20736, 361]

    Here the element 36100 in b has no matching squared rooted value, 190, in a, so the return of the comp function should be false. But the test seems to expect true.

  • Custom User Avatar

    Then your code is not correct, you're trying to read the length of something (null) that hasn't that property. You need to check what the value is first.

  • Custom User Avatar

    the error is : Cannot read property 'length' of null. But all the test are fine. Help me please.

  • Default User Avatar

    Would you mind reading the error..? And telling us what it is? :P

  • Custom User Avatar

    Hi, the test cases do pass null for one of the arrays in a couple of tests, so you can't make the arguments required unless you supply a default value. As far as your tests not passing in the test case, are you by chance modifying the source arrays in your code? The arrays are passed by reference so modifying the arrays in the random tests could affect how the reference solution behaves in the test suite. Can you be more specific about which test is failing when you run your code?

  • Custom User Avatar

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

  • Default User Avatar

    probably not a problem with the JavaScript code; it has 6,319 completions. if you have a specific question someone may be able to help you.

  • Custom User Avatar

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