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.
Nice :) fixed
I'll republish first of April 2025.
This comment is hidden because it contains spoiler information about the solution
Thanks, I'll combine both other ideas, without extreme performance requirements.
If you have the potion in stock and somebody wants it, you provide it. However, when you need to construct one, and the alchemist does not know how to compose it, you cannot compose it. This is a case I will add to sample tests.
Thank you, typos have been addressed.
No, the tests are wrong.
These two expression are matematically equivalent (and both correct), but using floats they may generate slightly different results:
.
Float results should be tested using approximate equality (
test.assert_approx_equal
in python).More on floating point numbers:
Respectfully, I think your solution doesn't work, because it only works on some random test cases.
My solution and many other solutions work for every random test.
Please let me know if I'm wrong.
I'll mark this resolved for now.
Like which ones? I just tested them all and they all worked.
And the people have spoken! I'll take out the starter code and we'll see what people come up with!
Seconding the suggestion to remove the starter code, but if you do keep it, you should avoid the
hash
variable name as it overrides the built-in function of the same name in python.Thanks for the feedback! Glad someone likes it already :)
As for the boilerplate, Id be fine with either, but I think having some standard structure doesnt hurt, since I dont think as written it gives anything away. (Makes reading solutions easier too IMO)
Since the main burden of the kata was figuring out how to manipulate the language operators and the casting properly, I'd go further and say I wouldn't have minded leaving the required hash parameters present.
The external research required (if any) is just an added task for the reader to provide some realism to a minor research focused problem.
I have read test codes of other katas and updated my tests accordingly. Please confirm that there are no other issues.
Thank you!
#help-author
channel of Codewars Discord.Loading more items...