Draft

Where do the buses meet?

Description
Loading description...
  • Please sign in or sign up to leave a comment.
  • FArekkusu Avatar

    Iterate over an array and compare values

    The idea is not novel at all. You could at least enforce O(1) solutions...

  • JohanWiltink Avatar

    How can the stops array be empty ?!?

    I'm tempted to think that's physically impossible - there would be no starting position for the buses.

  • FArekkusu Avatar

    No random tests.

  • JohanWiltink Avatar

    Returning inconsistent data types is not a best practice.

    Consider 0 or -1 instead of "no meeting" ? Or throw some Error.

    • FArekkusu Avatar

      This really should have been an issue.

    • JohanWiltink Avatar

      Could have been. But it doesn't make the kata unsolvable.

      Of course, I could have raised it as an issue, along with all the others, and then raised "no random tests" as a suggestion. :yum:

    • FArekkusu Avatar

      it doesn't make the kata unsolvable

      But the kata can't be translated directly because the author threw in some stupid requirements, and we end up with "do X in lang1/lang2/lang3, do Y in lang4/lang5/lang6/lang7/lang8, do Z in lang9/lang10...".

    • JohanWiltink Avatar

      I was giving author some benefit of doubt, but I'm gravitating more and more towards "who would want to translate this crap anyway?" .. :/

      It needs a lot of work before it's ready for prime time.

    • FArekkusu Avatar

      who would want to translate this crap anyway

      Implying this gets out of Beta of course. If the kata is doomed, there's no point in translating it for sure.

    • wildhamster26 Avatar

      Wow. OK.

      I've learned a lot from your feedback and will implement it in the next kata.

      This one will be unpublished immediately.

      Thanks.

      Suggestion marked resolved by wildhamster26 6 years ago
  • JohanWiltink Avatar

    Description and Initial code are inconsistent with Example tests: number of arguments is different. I can only hope Submit tests are consistent with Example ones.

  • JohanWiltink Avatar

    Direction of buses is unspecified. Apparently, the second bus reverses through the array?

    Do not rely on examples for these things. It makes us mindreaders, and we are not.

    • JohanWiltink Avatar

      And there goes .. buses only ride their route once, apparently.

      No bus I know does that.

      ( Actually, they usually ride from start to end and then back to start, instead of what I programmed. )

  • wildhamster26 Avatar

    Hi everyone. :)

    I wrote this simple loop practice kata, but I'm having some problems with the randomized tests. It seems like any array I pass as a parameter that is longer than 1 (stopsArray=[1]) breaks the tests as a performance issue.

    I've checked a few possibilities and got down to hardcoding a 100 item array (instead of loop-pushing it) in an attempt to improve performance, but the second I change the array for the randomized tests from [1] to [1, 2] it breaks...

    Any ideas why it happens and how to fix it?

    Other than that any feedback will be welcomed, of course.

    Thanks in advance and I hope you enjoy this simple kata.