Ad
  • Custom User Avatar

    Tests are correct. We don't know what you are printing, we don't know which language you are using. Make sure to follow carefully the description. Anyway, this is not a suggestion (?).

    You should have a look there: https://docs.codewars.com/training/troubleshooting/

  • Custom User Avatar

    I found out that:

    a = []
    b = []
    comp(a,b)
    Expected: true
    

    But instructions says othewise

  • Custom User Avatar
  • Custom User Avatar

    You must put quotes around fmt. Not a kata issue.

  • Custom User Avatar

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

  • Custom User Avatar

    I don't do Go, so I wouldn't know :P

  • Custom User Avatar

    @B1ts it's a standard codewars compiler.

  • Custom User Avatar

    Now you know what you have to do (and it is explicitly stated in the description).

    It's normal fmt shows an empty slice when printing nil here: in this case nil is the value of an uninitialized container (and has length 0...). Go subtleties...

  • Custom User Avatar

    Looking at the tests suite, actually the last test you see is with 2 nil inputs. Not sure why your code prints them as []

  • Custom User Avatar

    As already was mentioned by @GurovSD, Golang has a problem.
    Two tests with an empty arrays. According to tests, the first result should be true and the second is false.
    Look at this output:

    [121 144 19 161 19 144 19 11]
    [121 14641 20736 361 25921 361 20736 361]
    true
    
    [121 144 19 161 19 144 19 11]
    [231 14641 20736 361 25921 361 20736 361]
    false
    
    [121 144 19 161 19 144 19 11]
    [121 14641 20736 36100 25921 361 20736 361]
    false
    
    []
    []
    true
    
    []
    [25 49]
    false
    
    [121 144 19 161 19 144 19 11 1008]
    [121 14641 20736 36100 25921 361 20736 361]
    false
    
    [-10000000 100000000]
    [100000000000000 10000000000000000]
    true
    
    [10000001 100000000]
    [100000000000000 10000000000000000]
    false
    
    [2 2 3]
    [4 9 9]
    false
    
    [2 2 3]
    [4 4 9]
    true
    
    [-121 -144 19 -161 19 -144 19 -11]
    [121 14641 20736 361 25921 361 20736 361]
    true
    
    []
    [121 14641 20736 361 25921 361 20736 361]
    false
    
    []
    []
    true
    
    Test Failed
    Log
    Expected
        <bool>: true
    to equal
        <bool>: false
    
  • Custom User Avatar

    Absolutely the same issue in Golang.
    Look at this output:

    [121 144 19 161 19 144 19 11]
    [121 14641 20736 361 25921 361 20736 361]
    true
    
    [121 144 19 161 19 144 19 11]
    [231 14641 20736 361 25921 361 20736 361]
    false
    
    [121 144 19 161 19 144 19 11]
    [121 14641 20736 36100 25921 361 20736 361]
    false
    
    []
    []
    true
    
    []
    [25 49]
    false
    
    [121 144 19 161 19 144 19 11 1008]
    [121 14641 20736 36100 25921 361 20736 361]
    false
    
    [-10000000 100000000]
    [100000000000000 10000000000000000]
    true
    
    [10000001 100000000]
    [100000000000000 10000000000000000]
    false
    
    [2 2 3]
    [4 9 9]
    false
    
    [2 2 3]
    [4 4 9]
    true
    
    [-121 -144 19 -161 19 -144 19 -11]
    [121 14641 20736 361 25921 361 20736 361]
    true
    
    []
    [121 14641 20736 361 25921 361 20736 361]
    false
    
    []
    []
    true
    Test Failed
    Log
    Expected
        <bool>: true
    to equal
        <bool>: false
    
  • Custom User Avatar

    Oh, thank you! Did not notice that. Just fixed it.

  • Custom User Avatar

    Your code returnrs true for a = 100, b = 1 and c = 1.

  • 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

  • Loading more items...