Ad
  • Custom User Avatar

    Just found the mistake. My regex didn't match zeros and therefore it did not recognize +10 or -10 movements correctly. Sorry, my bad.

  • Custom User Avatar

    Manually executing those changes lead me to the expected value, not your submitted answer.

    Note that your submitted answer is [ 'l', 'e', 'Q', 'I', 'z', 'f', 'P', 'O', 'm', 'h', 'U', 'w', 'E' ] and the expected value is [ 'h', 'e', 'Q', 'I', 'z', 'f', 'P', 'O', 'm', 'U', 'l', 'w', 'E' ], not the other way around.

    You might be interpreting +n as moving right instead of left, but I have not checked that. Otherwise, I really don't know, but that test is definitely correct.

  • Custom User Avatar

    I have already reset, there still to many tests failing

    Here is another test result:

    expected [ 'l', 'e', 'Q', 'I', 'z', 'f', 'P', 'O', 'm', 'h', 'U', 'w', 'E' ] to deeply equal [ 'h', 'e', 'Q', 'I', 'z', 'f', 'P', 'O', 'm', 'U', 'l', 'w', 'E' ]

    leaderboardSort(["l","z","f","e","O","m","P","I","U","h","w","E","Q"], ["Q +3","Q +5","I +2","h +10","f -4","P +1","z -5","f -1","O +1","Q +0","l -10","O -5","l +1"])

    There is nothing smaller sorry

  • Custom User Avatar

    Make sure you have the correct tests ( reset ), and can you post a smaller counterexample?

  • Custom User Avatar

    does not work for me. I carefully went through all changes by hand and I know my algo spits out the correct changes to the board. Test this my result is:

    assert.deepEqual(leaderboardSort(["ivy","uQV","YiJ","pBO","uhU","RHK","zJx","bhQ","pcj","LbZ","QJv","usq","uZi","KFM"], ["QJv +9","uZi +8","pcj +8","usq +7","pcj -11","usq +3","uQV -3","bhQ +7","uhU +3","LbZ +8","LbZ -10","pcj +3","ivy -9","KFM +9"]), [ 'usq',
    'QJv',
    'bhQ',
    'KFM',
    'YiJ',
    'uhU',
    'uZi',
    'pBO',
    'uQV',
    'pcj',
    'ivy',
    'RHK',
    'zJx',
    'LbZ' ]);

    Result : [ 'pcj',
    'QJv',
    'usq',
    'bhQ',
    'KFM',
    'LbZ',
    'YiJ',
    'uhU',
    'uZi',
    'uQV',
    'pBO',
    'ivy',
    'RHK',
    'zJx' ]

  • Custom User Avatar
  • Custom User Avatar

    It is now, but it was ok immediately after approval last time.

    Check again tomorrow.

  • Custom User Avatar

    Is it ok now?

  • Custom User Avatar

    It looks like the JS tests got rolled back to the first translation version. That suffered from major issues, and had been fixed. But it's unfixed now.

  • Custom User Avatar

    You're probably relying on undefined behaviour.