Ad
  • Custom User Avatar

    Phew!!! What an amazing kata! really thorough and illuminating test cases too. The Track parsing was insane

  • Custom User Avatar

    Hmm. Interesting question.

    A diagonal crossing is defined by this Kata as below:

      \ /
       X
      / \
    

    So I think the track you have drawn is either:

    • not actually a "valid" track, or
    • your "crossing" might be considered more like a bridge/underpass

    Either way I don't think a crash can occur there.

  • Custom User Avatar

    Is this an example I should be worrying about or is it illegal?

    /--\
    |  |
    \-\/
      /\
     /  \
     |  |
     \--/
    

    The reason I ask is that the diagonal lines are technically crossing but a train could never occupy the same point in space while inside this crossing which makes it quite a challenge to consider if they have crashed.

  • Custom User Avatar

    Interesting challenge, I tried a lot of approaches and failed alot before getting a solution that didn't time out. Would it be possible to leave the expected time and space complexity in the Kata description to make it clearer when beginning the Kata what is expected? Also, it is not obvious how high the random tests go but in python I pass the random tests as long as the tests dont go higher than node len(16500) which is not clear to me if I have a) actually beat the challenge and it's not optimised for python or b) lucked out with the random tests and didn't really beat it

  • Custom User Avatar

    It's already in the examples in the description, read them again.

    ...
    helper.page_index(-10) # should == -1 because negative indexes are invalid
    
  • Custom User Avatar

    Not sure if negative indexing is meant to be illegal for the pagination helper class, not mentioned in the description however given the tests include negative indexing this should probably be specified.