Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Apparently, graph walking is not necessary for this problem, there are very few path strategies for a symmetric web.
Problem description is too vague and uncertain. Not a single mention of the desired result. It was just broken code, comments and some clues from tests. Please improve the description, at least to the level when it's possible to think of solution without starting the kata and looking at the unfinished code.
It's not algorithm problem, it's pure math. Suggest to remove tag
Algorithms
, add tagMathematics
and reduce difficulty level to7 kyu
.This comment is hidden because it contains spoiler information about the solution
Horrible solution. Perfect example of how to kill performance by making code shorter. Solutions here are expected to have
O(n)
and compete only in number of passes through the list, but this one manages to get toO(n^2)
.There is an issue for original kata and you better not inherit it. There really should be explicit tests with repeating minimum in the array. For example
[3, 4, 3, 5]
should produce6
, not7
. I guess, single fixed test is ok.The solution is incorrect. It fails if the minimum element repeats anywhere in the array.
This comment is hidden because it contains spoiler information about the solution
Ants NEVER collide more than 2 at once in one place. In this case particularly the middle one first collides with the right one and then (after changing direction) with the left one:
(time goes from top to bottom)
There is a harder version of this kata. https://www.codewars.com/kata/65e4b8877e8acd0dbae9a14f
There is wider kata about computing regular expressions for divisibility tests. https://www.codewars.com/kata/5993c1d917bc97d05d000068
Instead of having single
@Test
with loop inside (it is actually many tests!) use@RepeatedTest
instead.Added to description and tweaked slightly some tests
Good point! Done
This comment is hidden because it contains spoiler information about the solution
Loading more items...