Ad
  • Custom User Avatar
  • Custom User Avatar

    Fixed.

  • Custom User Avatar
  • Custom User Avatar

    Fixed.

  • Default User Avatar

    By the way, please post as a question if you're unsure about your code. Posting as an issue is reserved for when there's a problem with the kata.

  • Default User Avatar

    are you mutating input?

  • Default User Avatar

    in Python: solution is visible in test feedback

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    There seems to be a problem with the random tests in Python 3.6, looking at the other issues, I can confirm this is not due to mutation of the input, this is a new dict being returned.

    Example:

     Testing for {1: 'Lazio', 2: 'Milan', 3: 'Roma', 4: 'Juventus', 5: 'Inter', 6: 'Torino', 7: 'Liverpool', 8: 'Arsenal', 9: 'Fiorentina'}
     Log
    Input:
    1: Lazio
    2: Milan
    3: Roma
    4: Juventus
    5: Inter
    6: Torino
    7: Liverpool
    8: Arsenal
    9: Fiorentina
    -=-
    Output:
    1: Lazio
    2: Arsenal
    3: Fiorentina
    4: Inter
    5: Juventus
    6: Liverpool
    7: Milan
    8: Roma
    9: Torino
     STDERR
    Traceback (most recent call last):
      File "main.py", line 16, in <module>
        Test.assert_equals(premier_league_standings(teams),sol(teams),"It should work for random inputs too")
      File "main.py", line 10, in <lambda>
        sol=lambda t: {i+1: k for i,k in enumerate([t[1]]+sorted(k for i,k in t.items() if i!=1))}
    KeyError: 1
    

    As you can see in the output - the key 1 is present.

  • Custom User Avatar

    The user can modify the input in Python (at least).

  • Default User Avatar

    Solving for JS, the random tests are expecting Inter to come before Coventry alphabetically. Has anyone else experienced this? It switches places 3 and 5 with Florentina in the middle.

  • Custom User Avatar

    People, your guys included, should be taught when to use an Object and when to use an Array. Because there is a difference. Accessing an Array is an O(1) operation; accessing an Object is an O(log size) operation.

    So this might not be the ideal example to teach about Objects, because author just reinvented an Array as an Object. There would be more suitable examples.

  • Custom User Avatar

    I liked the concept of this kata but it seems fairly easy to kind of cheat on it. I feel the point of it was to train using objects but a lot of ppl are just turning the object into an array, using the sort() function, then making it into an object again. So I think that might be a flaw.

  • Default User Avatar

    Approved - thank you for the translation! :)

  • Default User Avatar

    Added - thank you :)

  • Loading more items...