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.
Thanks for the correction, Steffan153
You are so right, dinglemouse! "warning: function returns address of local variable".
Thanks for pointing that out to me, highly appreciated.
Thanks for this very instructive Kata, Jomo Pipi.
Are you sure of your solution?
Here three cases where your solution is off by one day compared to http://www.aavso.org/jd-calculator.
(3000, 5, 2) -> 2816909 should equal 2816910 - 2816909 is correct according to the linked calculator
(3001, 1, 7) -> 2817159 should equal 2817160 - 2817159 is correct...
(2100, 6, 4) -> 2488224 should equal 2488225 - 2488224 is correct...
Had to "attempt" several times before getting my solution approved by your random tests.
The description is not totally correct. It states "...(because "Bob" is a string and not an int value)", while one test case is "Test.assert_equals(tax(1.2), 1.26)". Either change "int value" to "number" or exclude floats in the tests.
Your fix has not yet percolated into the python version, as far as I can tell...
For the sample tests in Python (lines 11 to 13):
What is wrong with 1111? The random tests show many similar problems...
Am I misunderstanding the description, as there seems to be one successful Python answer?
Also, is the class name typo in Python (class BullAndCows:) ment as a "trap"?
Elegant
.
Thanks for the collections.Hashable, clearly more generic :)
Test.assert_equals(smaller([2] * 20000 + [1]), [1] * 20000 + [0]) in about 100ms
Decent speeds here for large lists, while the top rated solutions choke to death.
This solution generates a list, not a string.
This solution only generates "111..." or "000...".
Hello Temporarist. Any reason why you picked "L" as the function name? Does it have a special meaning? By changing the function name to "l" for instance, I get "RuntimeError: maximum recursion depth exceeded" but a capital "L" works fine... Tried to google it, but to no avail. Any insight would be highly appreciated.
Loading more items...