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.
Nice kata!
Julia translation
Haskell translation
I have added some for the Rust translation, but ran into an issue with the enormous size of the return values, which I've listed them above.
If such tests are acceptable, I can update the JavaScript version as well.
Rust translation kumited.
It includes random tests, but due to the returned
String
increasing rapidly in length withn
it is limited to [0, 39]:String
lengthI used
None
instead of-1
forn = 0
, as the former is more idiomatic in Rust.No random tests.
Very nice kata. I liked to solve it, I got a lot of fun!:)
The kata is very fun, but the interface of the given function is poor. Since Swift is strongly typed, the interface should make use of that instead of allowing users to pass a
nil
as the argument.Why 62847?
There's a typeo in the test cases when you test
getLines(5)
. And really you should just convert all of the tests over fromTest.expect
to useTest.assertEquals
instead. Like this:The
Test.assertEquals
method already has all the built-in logging to give a helpful message. E.g.getLines(5) - Expected: 1,11,21,1211,111221, instead got: (something else)
or
Test Passed: Value == 1,11,21,1211,111221
It's a typeo. It should say "getLines(5) should return (5th line), instead got (what your solution returns)".
if you have the array then you have the comma separated list (arr.join(","))
This comment is hidden because it contains spoiler information about the solution
Loading more items...