Draft
Where do the buses meet?
Loading description...
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
The idea is not novel at all. You could at least enforce
O(1)
solutions...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.
No random tests.
Returning inconsistent data types is not a best practice.
Consider
0
or-1
instead of"no meeting"
? Or throw someError
.This really should have been an issue.
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:
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...".
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.
Implying this gets out of Beta of course. If the kata is doomed, there's no point in translating it for sure.
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.
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.
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.
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. )
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.
https://www.codewars.com/kata/reviews/5c62edbbb1e3560001307fb9/groups/5c62f23148080b00016c3ba6
;-)
Also you should add random tests, issues are coming in very soon ;-)
Why do you even write out the array? It's defined by its length.
The problem might be caused by random values for
bus1
andbus2
that can be zero.