Ad
  • Default User Avatar

    yes, I am beginner and sorry for my mistake
    but ... when I print input data before I start doing anything

    func SquareOrSquareRoot(arr []int) []int{
    fmt.Println(arr)
    ...

    then I get on terminal [88 48 60 82]

    and in log:
    Expected
    <[]int | len:4, cap:4>: [7744, 2304, 3600, 6724]
    to equal
    <[]int | len:4, cap:4>: [88, 48, 60, 82]

    so expected ouput is equal to input array?

    ok ... so to test this case I changed my function to

    func SquareOrSquareRoot(arr []int) []int{
    fmt.Println("input data", arr)
    return arr
    }

    and in log:

    input data [88 48 60 82]
    Expected
    <[]int | len:4, cap:4>: [88, 48, 60, 82]
    to equal
    <[]int | len:4, cap:4>: [7744, 2304, 3600, 6724]

    so 2 different expected outputs for same input?


    EDIT: ok, my mistake ... I dont catch "The input array should not be modified!"
    that was my mistake ... thanks for patience

  • Custom User Avatar

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

  • Default User Avatar

    this is still valid issue ... Please can anyone fix it?

  • Custom User Avatar

    thanks for raising this, I couldn't understand what am I missing!