Ad
  • Default User Avatar

    Just renaming result to steve_wins and l to total_non_ties could do it much easier.

  • Default User Avatar

    Hello. The problem is you can't just compare directly, as alphabetical order isn't equal ranking here, as 'T' < 'J' is False.

  • Default User Avatar
  • Default User Avatar

    Is it somewhat more performant than a "default" (simple join) solution?
    Like, it applies limit only on the first subquery, so there is no need to watch the whole customer's table.

  • Default User Avatar
  • Default User Avatar

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

  • Custom User Avatar
  • Default User Avatar

    Yep, I was confused by making bad experiment.

    I tried on range(10)[1:5] -> >>> range(1, 5) - returns something not because range is just generator but because it returns object that support supsbcirping (or how it calls).

    On

    def yielder():
      yield 'yeet'
    

    or simpler (elm for elm in 'yeet')[1:3]

    returns TypeError: 'generator' object is not subscriptable

  • Custom User Avatar

    ofc, since it's not possible... x)
    the list is built first, then it's indexed

  • Default User Avatar

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

  • Custom User Avatar

    I think you are making things difficult for yourself by imagining rules that don't exist.

    e.g.

    Kata says:

    The terrain never starts or ends with a gap

    This means the ants can WALK in and WALK out of the terrain (avoiding complications of bridges with only one known end)

    It does NOT say there is some magic platform at the end with "solid ground with enough space for all ants".

    Kata says:

    What order do they exit on the right hand side?

    So you know they do not stand around mingling on some imagined platform having some kind of ant party. They EXIT.

  • Default User Avatar

    Sory for delay.
    So, like it seems natural that it's about all ants, but where is the end of the right hand side? Is it will be that last platfform as in -...-.-? Also The terrain never starts or ends with a gap it doesn't matter then is terrain ends with gap or not. I'm not native English speaker and maybe it's just my fault yet maybe we need something like additon in braces until all the ants reach the right hand side (solid ground with enough space for all ants).

  • Custom User Avatar

    Why is this an issue? Kata description already says:

    This process repeats ... until all the ants reach the right hand side.

    NOTE: all ants

    What part is not clear?

  • Default User Avatar

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

  • Default User Avatar

    OMFG!!! That isn't obvious, I spend 2 days solving it thinking that we should return state as ants stops at right end of terrain.

  • Loading more items...