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.
"Having a failure share representation with success can lead to failures accidentally being treated as success."
If you can treat negative length of the side as a success it means you didn't understand the task. You can't have a piece of stick of a negative length.
"If not knowing about the possible None, that is still better than not knowing about the possible -1, being forced to deal with it is the whole point."
None can be an indicaion that there occured some case that your code didn't take care of. I still opt for -1 as an indication of no square case.
"s/brake/break"
I didn't understand it. Where is it? How did you come across it?
I would like the output to remain integer.
Both 0 and -1 make equal sense to me, both indicate that there can be no square constructed.
Fair point.
Mind sharing your opinion on the kata description?
Solutions using sqrt() for validation should no longer pass.
The one that you posted is not passing anymore for two reasons:
Thank you for your feedback!
If there is anything else to fix in any of your issues please reply.
For now I mark all 3 of them as resolved.
Done :)
I do not know yet how to fix it but I will figure it out.
I found the word "biggest" more suitable and added a section in the description.
Is it more clear now?
Thank you for feedback :)
I changed the description. Is it better now?
I added random tests, please try now.
You get two sticks which you can brake into pieces of integer length. Your task is to construct the biggest possible square from those pieces. You need 4 pieces of equal lengths for a square. You have to return the side of the biggest square that you can construct or -1 if your sticks are too short.
This is my first kata, thanks for feedback.