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.
I originally had other plans and then didn't want to rewrite everything, since it works.
Having a digit is a requirement for a number. "[...] digits and [...]"
As far as this Kata goes none of your suggestions count as numbers.
Defining what is and what is not a number can get rather tricky. Please try to use the common sense a grade schooler would use to evaluate this question.
testing(number,[smallestnumber], indexBefore, indexAfter)
Move the digit on the smallest index.
Maybe this helps. You do not swap, you move one digit to another place.
C++ seems to have problems with rounding. It only worked with one exact equation, other variations had my solution be off by 1 compared to the expected result.
Hitting submit and scrolling down, I see the message "Congratulations, You pass the test![...]". However, I also failed 6 of the 103 tests. Maybe a little too early for congratulations : )
JavaScript: Kyu 8 cannot be expected to know how to write their own tests. Please provide some sample tests.
The description seems to have a typo.
{ -2, -1, 0, 1, 2 } -> 6
1. Square numbers greater than zero:
{ -2, -1, 0, 1, 4 }
2. Multiply by 3 every third number.
{ -2, -1, 0(*3), 1, 4 }
3. Multiply by -1 every fifth number.
{ -2, -1, 0, 1, -4 }
4. Return the sum of the sequence. -->
-6
, not6
C#: It's interesting to see how many people throw Linq at a problem that can be reduced to a one-liner with Regex.
Wouldn't it be actually harder to hardcode the solutions in this case than to just solve the problem?
Nice kata. Reminds me to continue my series on kana (https://www.codewars.com/kata/kanakonverter-ii). Maybe later,...
Language: C
I'm suspecting that the hidden test cases are wrong, but can't be sure, since they hide what they expect. For example, I'm getting
nptuq nmml abi diavjjxwsozq r igldbbi qub wwcfpfprcydau (null)
Test Crashed
Exit code: 0
Signal code: 11
.Copying this string to the initial test cases produces the same output, when I'm providing a wrong solution, like:
Test(longest_word, test) { cr_assert_str_eq(longest_word("nptuq nmml abi diavjjxwsozq r igldbbi qub wwcfpfprcydau"), "WRONG");}
but it will pass with the correct solution:Test(longest_word, test) { cr_assert_str_eq(longest_word("nptuq nmml abi diavjjxwsozq r igldbbi qub wwcfpfprcydau"), "wwcfpfprcydau");}
It would be nice, if failed tests tell you the solutions they expect. Like:
Test(longest_word, test1) { cr_assert_str_eq(longest_word("three two one"), "three", "Expected solution: three");}
But under
should_pass_all_the_tests_provided
I'm getting:Src: 65325, guess: 12436
(In src 5 is repeated) and then:expected: "3 0 helpful" but got: "wrong!"
,.. why?At least for C#, there aren't actually many similar ones. Searching for "rotate matrix" only yields one comparable result.
I certainly wouldn't have noticed this as a duplicate and I solved a lot of C#-kata :)
C#: In the test cases "expected" and "but was" are the wrong way around.
This is really confusing. For SQL Server it's exactly the other way around:
https://docs.microsoft.com/en-us/sql/t-sql/functions/log-transact-sql
Loading more items...