Ad
  • Custom User Avatar

    I'll close this then.

  • Default User Avatar

    Sorry. Looks like I somehow change it. I found error in my code and Attempt tests are now pass. Thank you

  • Default User Avatar
  • Custom User Avatar

    No, it's like this:

    Expected <------ THIS IS YOUR WRONG ANSWER, NOT THE INPUT
        <[]int | len:20, cap:20>: [5, 6, 8, 1, 7, 3, 1, 9, 0, 1, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0]
    
    to equal <------- THIS IS THE RIGHT ANSWER
        <[]int | len:20, cap:20>: [5, 6, 7, 8, 1, 1, 3, 1, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
    

    To see the input, print it: https://docs.codewars.com/training/troubleshooting#print-input

  • Default User Avatar

    This is details of the kata:

    Write an algorithm that takes an array and moves all of the zeros to the end, preserving the order of the other elements.
    

    It has line preserving the order of the other elements.

    Here is a test that codewars runs. It's not my result it is INPUT and OUTPUT of codewars test:

    Expected <------ HERE IS INPUT
        <[]int | len:20, cap:20>: [5, 6, 8, 1, 7, 3, 1, 9, 0, 1, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0]
    
    to equal <------- HERE IS OUTPUT
        <[]int | len:20, cap:20>: [5, 6, 7, 8, 1, 1, 3, 1, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
    

    Look at value with index 2. Input have 8 and Output have 7. This is wrong according to the task.

  • Custom User Avatar

    Please print the input too. With only that Information the only thing we can see is that your answer is wrong.

  • Default User Avatar

    All Test Cases (except one) for Go are incorrect.They are not presserving order of not zeroes values

    Expected
        <[]int | len:20, cap:20>: [5, 6, 8, 1, 7, 3, 1, 9, 0, 1, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0]
    
    to equal
        <[]int | len:20, cap:20>: [5, 6, 7, 8, 1, 1, 3, 1, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
    
    
    Expected
        <[]int | len:7, cap:7>: [1, 2, -1, 0, -2, 1, 0]
    
    to equal
        <[]int | len:7, cap:7>: [1, -1, 2, -2, 1, 0, 0]