Why my answer with n1011121314151617123456789\n0111213141516171234567891 is wrong and test case \n1011121314151617123456789\n1112131415161712345678910 is right?
First of all, WHY Strings and not just numbers? For a 7 KYU this constraint just causes way too much problems with padding 0's at the end (At least when working in Haskell).
Second of all, the rounding and float imprecision cause additional problems. I have 5/10 Tests passed, with two tests not passed because of the missing end zero and the other because of some weird imprecision (eg. I get 2.39, actual should be 2.40 or 2.38).
In JavaScript, if random tests generate n=0, the reference solution expects the output to be '0', which contradicts the rules in the description: If n < 1 then it should return "" i.e. empty string.
Java:
Actual and expected of random tests are swapped
Should use assertion messages instead of logging
Reference solution should be
private
C# random tests almost always expect
false
Edge case for
is not tested in
No random tests in
Elixir
Go
C++ is missing
#include <string>
in the initial code + testsThe Python random tests' structure is ill-formed, causing a red assertion to show up even when passing the kata.
should be:
Why my answer with n1011121314151617123456789\n0111213141516171234567891 is wrong and test case \n1011121314151617123456789\n1112131415161712345678910 is right?
First of all, WHY Strings and not just numbers? For a 7 KYU this constraint just causes way too much problems with padding 0's at the end (At least when working in Haskell).
Second of all, the rounding and float imprecision cause additional problems. I have 5/10 Tests passed, with two tests not passed because of the missing end zero and the other because of some weird imprecision (eg. I get 2.39, actual should be 2.40 or 2.38).
Lua translation
The description is rather confusing - it would be nice if the sequence was defined other than the example.
Java: actual and expected are swapped in the assertions (should be
(expected, actual)
)In JavaScript, if random tests generate n=0, the reference solution expects the output to be '0', which contradicts the rules in the description:
If n < 1 then it should return "" i.e. empty string.
This kata is a subject to deduplication process here: https://github.com/codewars/content-issues/issues/206.
Please join the discussion to help us identify duplicate kata and retire them.
Just a grammar correction:
upto
is not a word. The correct spelling isup to
.Sorry, but I've been doing all the Complete the Pattern katas, and that's been bothering me.
This comment is hidden because it contains spoiler information about the solution
Loading more items...