Ad
  • Custom User Avatar

    Thank you all for taking the time to answer my question. @ytorn is correct, I can't use console.log() because of large size data. Just to clarify, I'm not receiving a timeout, the tests complete on time but the array Im returning is not equal to the expected one. I tried to login games, Rank, Team, For, etc but the only thing Im receiving is "expected [ Array(#) ] to deeply equal [ Array(#) ]". That's why I was wondering if maybe some good sould have a large dataset to test my code :)

  • Default User Avatar

    Thanks for clarification!

  • Default User Avatar

    Do you get a timeout? Then you may need to optimize your code. Otherwise I tried to debug my code by printing the table with Rank, Team, For, Against, GD, Points like in the description. Maybe this could be helpful.

  • Default User Avatar

    The output should be an array of ranks for each team, not an array of teams for each rank. So the array [4, 4, 6, 3, 1, 2] means that the rank of Team 0 is 4, the rank of Team 1 is also 4, ..., the rank of Team 5 is 2.
    A team, which has not played yet, got 0 points, 0 goals scored and 0 goals conceded. But with these stats the team can still be ranked.

  • Default User Avatar

    You cant debug with console.log() because of large size of data. I can't see neither input data (games), it looks like "... 422534 more items ]", nor output "expected [ Array(978) ] to deeply equal [ Array(978) ]". Any thoughts how to solve this if you even don't know where the problem is hidden? As it was said above, all smaller tests are passed successfully.

  • Custom User Avatar

    What the error message of the failed test? Btw, when 'big' tests are failing, I try to debug the code with console.log() for example. I hope this can help you to investigate the issue in your code.

  • Custom User Avatar

    My code has passed all of the sample tests but it is failing for the bigger ones. Could you please provide me any suggestions on what to look for? what kinda situations may not be present on the tests cases that are being tested on the bigger cases? By any chance, would you have any big test case that you could share with us? Thank you!

  • Default User Avatar

    Why would team rankings for six teams given in the example come out as [4, 4, 6, 3, 1, 2] if --as the input data shows-- all teams have played a game? Teams 0 and 5 deserve to be in there!
    And there was no instruction how to handle instances where a team did not play.
    Perhaps as a guy always chosen last in gym class I am missing something here.

  • Default User Avatar

    Definite mismatch between the terse instructions and the difficulty level unless you are already comfotably using functional languages. Otherwise, once the trick of returning a function becomes clear, it's "So?"

  • Default User Avatar

    And here I expected a time penalty for brute strength solutions. . .

  • Default User Avatar

    Frankly, finding something hidden in the test data not truly described in the program requirements really does not prove much apart from tenacity on the part of the programmer, IMHO. It is not that records do not exist for the test case that is tripping up most folks from what I am reading here.