Ad
  • Custom User Avatar

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

  • Custom User Avatar

    @B1ts it's a standard codewars compiler.

  • 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

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

  • Custom User Avatar

    In the details writen "A word (string) of length 0 < str < 1000" but string of len 0 also has present.

  • Custom User Avatar

    Thanks. This line just confused me (from the go doc):

    "func Trunc(x float64) float64

    Trunc returns the integer value of x."

  • Custom User Avatar

    What is difference between math.Trunc(num) and just int(num) ?

  • Custom User Avatar