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.
C# Translation https://www.codewars.com/kumite/66e96891946b0edf0e00f453?sel=66e96891946b0edf0e00f453
Haskell translation
what about the 3 new chickens he bout in the second year
Fun kata, the full extent of the rounding is not obvious at the beginning but overall well designed!
Explanation of the egged(4, 8) example:
Year 1: Ronald starts with 3 chickens. Each chicken lays 300 eggs. So, the total = 3 * 300 = 900 eggs.
Year 2: The 3 chickens from Year 1 are still alive and now lay 240 eggs each (300 - 20%). Ronald also buys 3 new chickens that lay 300 eggs each. So, the total = (3 * 240) + (3 * 300) = 720 + 900 = 1620 eggs.
Year 3: The 3 chickens from Year 1 now lay 192 eggs each (240 - 20%). The 3 chickens from Year 2 lay 240 eggs each, and Ronald buys 3 new chickens that lay 300 eggs each. So, the total = (3 * 192) + (3 * 240) + (3 * 300) = 576 + 720 + 900 = 2196 eggs.
Year 4: The 3 chickens from Year 1 now lay 153 eggs each (192 - 20%). The 3 chickens from Year 2 lay 192 eggs each, the 3 chickens from Year 3 lay 240 eggs each, and Ronald buys 3 new chickens that lay 300 eggs each. So, the total = (3 * 153) + (3 * 192) + (3 * 240) + (3 * 300) = 459 + 576 + 720 + 900 = 2655 eggs.
Explanation of the egged(2, 1) example:
Year 1: Ronald has his initial 3 chickens. Each chicken lays 300 eggs. So, the total = 3 * 300 = 900 eggs.
Year 2: The chickens from the first year have already died (since their lifespan is 1 year).
approved by someone.
python new test frameworks
There's a "bug" in your solution, try checking with input
$num = 696
and see what is wrong.Not a kata issue.
The test cases generates palindrome numbers, so the test cases sometimes pass, and other times fails, will correct for PHP and publish
You are correct, sorry I got confused, and thought this was a problem, mod 10 indeed will return the last digit of any number which has more than 1 digit.
Just tried it on the language you used, PHP. Nope, nothing different. There's nothing wrong with using mod.
Not a valid kata issue, marking as resolved.
There's literally nothing wrong with using mod operator. Unless it has different behaviour on certain number in your language?
This comment is hidden because it contains spoiler information about the solution
Pretty funny and challenging kata, well done, compliments.
Loading more items...