Ad
  • Custom User Avatar

    I have error:
    Testing for [8, 0, 0, 0, 7, 0, 4, 1, 5, 7, 0, 0, 6, 6, 1, 0, 0]
    It should work for random inputs too - Expected: [8,0,7,4,1,5,7,0,6,6,1], instead got: [8,0,0,7,4,1,5,7,0,6,6,1,0]
    But as I understand it should pairing in this way:

    source: [8, 0, 0, 0, 7, 0, 4, 1, 5, 7, 0, 0, 6, 6, 1, 0, 0]
    paired:     ^--^  ^-----^              ^--^           ^--^
    result: [8, 0,    0, 7,    4, 1, 5, 7, 0,    6, 6, 1, 0   ]
    

    At least according to rule "0's generated by pairing can NOT be paired again" for 8 zeros in source we should have 4 zeros in result.
    What is wrong - test or my understanding?