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.
Hi, thanks for taking the time to look at my problem. I'll make changes later.
Hi, the solution will pass only if you find a way to solve the problem without loops. as wrotes below in the comments inList numbers are sequentially from 1 to n this should help you to solve the problem without loops
your solution has a bug that incorrectly handles four zeros in sequence
example input data [9, 0, 0, 0, 0, 0, 9]
your code will return [ 9, 0, 9, 0, 0, 0, 0, 0 ]
Suggestions:
add
toint Function(int) add(int n){ ... }
and solution setup to something like:I think that this looks much nicer in strongly typed languages. If someone will solve it with
dynamic
then fine, but static types are so much neater :)add(x)
. Users who do not know how to do "functions in functions" will attempt to return strange things fromadd
, and tests will crash attempting to call an uncallable thing, resulting in confusing failure messages. You can try something likeexpect(add(x), isA<int Function(int)>(), reason: "\nadd(x) should return a function");
, maybe extracted to a helper function like following pseudocode:(make sure to use
reason:
for clear failure messages).Hi I checked
your code gives wrong result for
this sequence [9, 0, 0, 0, 9, 1, 2, 0,
1, 0, 1, 0, 3, 0, 0, 1,
9, 0, 0, 0, 0, 0, 0, 9] can you check locally
javascript kata tests output incorrectly expected results and obtained results from the user
needs to be checked
Translation Dart
I don't quite understand you. Can you show me an example?
I was thinking about using 3-tuple for the return type, which is always a value with three integers. What do you think?
Hi in dart there are tuples and there is a fixed array, what are these data structures for in this task?
The test headers were taken from python solution during translation
Does Dart have 3-tuples or fixed size arrays?
I would also suggest more concise titles for tests sections, like just
"humanYearsCatYearsDogYears(1)"
instead of"Test humanYearsCatYearsDogYears one"
or"Random test 42: humanYearsCatYearsDogYears 1 human years"
. I think that it's sufficiently clear, more concise, and easy to copy and paste into local IDE.now on dart
Translation Dart
No, that's a bug. Fixed it. Thanks.
This translation has no example tests, is this intentional?
needs to be checked
Translation Dart
you don't know the ascii table by heart 0_0
Loading more items...