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.
This comment is hidden because it contains spoiler information about the solution
Translated from C#. I'm new to F# so careful review recommended.
F# description tells to return
Nothing
if conversion is not possible. For F# it should readNone
instead ofNothing
.F# description talks about arrays, but tests expect a list.
This comment is hidden because it contains spoiler information about the solution
Compared to other solutions here mine is overly verbose and has an unnecessary Seq conversion when Array.map exists.
Moved tests use statements to tests module. In the unlikely event of a user solution using
rand::thread_rng
orrand::seq::SliceRandom
there will not be a double import with this change.for Rust,
Description says that the input will only contain
/[a-zA-Z0-9]/
, however in the random test we generate random unicode characters. By writingprintln!("{}", text);
to the start of your solution, you will see that the random tests generate emojis, chinese symbols and stuff that the console will print as blocks.in
test_codewarsisawersome
we get string"CODEwarsIsAWesOmE"
and expect there to be 5 duplicates.My counts are:
By this manual counting method I actually got 5 duplicates, just as the test expects.
Maybe I counted wrong or misunderstood the issue. If that was the case, please ignore this comment.
I made a C# solution that throws an ArgumentException when the town has a zero. The solution passes sample tests and actual tests.
I'm fairly confindent that in C# the town has no zeroes.
This comment is hidden because it contains spoiler information about the solution
That does make more sense.
Some other languages (e.g. python, cpp, js) do allow
index1
to be higher. Perhaps that inconsistency has nothing to do with the quoted snippet of description.For Go
the description reads:
However, both actual and sample tests expect
two_sum([1,2,3], 4))
to equal[0,2]
.[2,0]
is a valid solution for the inputs, but it fails the tests.This comment is hidden because it contains spoiler information about the solution
I don't think the Kata solver has to deal with test generated warnings in any manner at all, simply ignore them.
You can pass the Kata while having warnings.
Loading more items...