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.
why
println(len(a), cap(a))
on both a and b on second and third default tests giving0, 0
?Golang
Did this in C and some of the tests fail with a wrong value but when I replace the failing string in my code I get right value. What could be the reason? Concurrency?
Although this is a good kata, I suggest that this kata's rating is changed to 6 or 7, as it is rather simple. I believe that the number of different ways to solve it keep it from being ranked as 8, though.
Don't get discouraged, though. Keep on making katas!
NO random tests in
C#
Elixir
Java
JS
Python
Ruby
RISC-V srli Implementation Issue: It turn out not to be logical shift
If you're getting incorrect results with large inputs (especially numbers > 2^31), check your srli (Shift Right Logical Immediate) results. Some implementations might incorrectly perform arithmetic right shift instead of logical right shift.
Example of the issue:
Input: 3435973832
Correct srli result (input >> 3): 429496729
Incorrect result seen: 4187593113 (arithmetic shift behavior)
Brute Solution: Mask the result after shift to ensure upper bits are zero:
This issue particularly affects calculations involving division by powers of 2 using right shifts on large unsigned numbers.
This comment is hidden because it contains spoiler information about the solution
No random tests
Tests log to console
I would like the tests to be more easily reproducible locally. The
use super::cakes;
did not build on my machine and I like to do the katas in my local IDE first.Groovy Translation
Python new test framework
Also refactors random test generation to be more sane, and resolves this
This should be prevented in Python
assertion messages for the PHP random tests are completely unhelpful:
Failed asserting that false is true
recipe: {("oil", 100), ("sugar", 150), ("milk", 100), ("flour", 300), ("apples", 3)}
available: {("apples", 15), ("milk", 2000), ("flour", 2000), ("oil", 20), ("sugar", 500)}
Expected: equal to 0
Actual: 3
But I tried to test my code in VScode. It output 0, but the KATA output 3. I don't know why.
PHP translation
This comment is hidden because it contains spoiler information about the solution
Loading more items...