5 kyu

Sports League Table Ranking

109 of 582cshw89
Description
Loading description...
Fundamentals
Algorithms
Arrays
Sorting
  • Please sign in or sign up to leave a comment.
  • ah2023 Avatar

    CS: I think the labeling in the error message is reversed for the following tests: RandomBig, RandomFull, RandomTestsAlmostEmpty, and RandomTestsManyShare

    Example: RandomTestsAlmostEmpty

    Test Failed Expected: null

    But was: < 66, 16, 4, 55, 76, 55, 36, 5, 34, 1, 35, 57, 60, 86, 6, 12, 16, 66, 60, 26, 19, 84, 40, 66, 26, 43, 26, 60, 26, 66, 43, 23, 77, 26, 50, 23, 66, 60, 74, 88, 43, 23, 12, 38, 6, 60, 85, 43, 57, 60, 6, 38, 21, 32, 20, 50, 74, 50, 50, 16, 40, 6, 2, 79, 43, 6, 66, 83, 77, 79, 12, 66, 2, 66, 32, 43, 40, 50, 26, 79, 86, 57, 6, 21, 79, 12, 43, 36 >

  • ahmet_popaj Avatar

    These sorting algorthims are always so sophisticated to program.

  • brodiemark Avatar
  • ppetr86 Avatar

    This comment has been hidden.

  • mwk48 Avatar

    Nice kata:)

  • albanesi Avatar

    When I Test my Code locally, it passes all Tests, but when i test it on Browser it just fails at test example3. I cant see any way how to debug the test and I cant understand any of the logs. Could you please correct this issue?

  • SimonSlominski Avatar

    This comment has been hidden.

  • gDoe24 Avatar

    Some of these tests are a little excessive. I am passing all the sample tests, but can't pass the final tests and can't compare because they're all too long to read and just say, "and x others"

  • Nima155 Avatar

    This comment has been hidden.

  • ytorn Avatar

    I found an interesting thing - my sorting function is working perfectly in browser, but the result differs in codewars, that's why I can't solve the kata. And this this is not a first time when results differ. Would be very thankful for any advices or explanation.

  • jsalinasf 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!

  • kmhmd 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.

  • Blind4Basics Avatar

    ruby:

    • the function's name should be snake_cased
    • the random tests don't look complient with the python/java version => ???
  • Blind4Basics Avatar

    the python version is a total mess... x/

    • solution setup is incorrect (contains Java/JS comment syntax)
    • every parts (solution setup, sample tests, test cases) contain commented out ruby code. Those should just be removed
    • expected/actual are swapped in example_random_single
  • Itsukaz Avatar

    assertArrayEquals(new int[]{2,3,4,1,5,6}, LeagueOrder.computeRanks(6, new int[][] {{0, 5, 2, 0}, {1, 4, 2, 2}, {2, 3, 1, 3}, {1, 5, 0, 0}, {2, 0, 2, 1}, {3, 4, 3, 1}})); I think the teams rank 5 and rank 6 have same rank 5 cuz both of them are: GD:-2 && P: 1

  • Glyxerine Avatar
  • dinglemouse Avatar

    From description:

    Team 5 and Team 4 reached the same number of points...

    Um, I think you mean Team 5 and Team 3

  • Voile Avatar
    Games:
    [ [ 0, 11, 1, 0 ],
      [ 1, 10, 1, 1 ],
      [ 2, 9, 0, 1 ],
      [ 3, 8, 0, 1 ],
      [ 4, 7, 0, 1 ],
      [ 5, 6, 1, 1 ],
      [ 1, 11, 0, 1 ] ]
    
    Expected: [1, 9, 10, 10, 10, 6, 6, 1, 1, 1, 6, 5],
    instead got: [1, 9, 10, 10, 10, 5, 5, 1, 1, 1, 5, 5]
    

    It seems that reference solution additionally tiebreaks by number of games played or something?