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.
You should defer calculations of sqrt as late as you can (not do it right away), trying to return as early as you can, and considering various edge cases.
Cool! I haven't seen a ternary used like this.
This comment is hidden because it contains spoiler information about the solution
This code that's "too slow" would pass easily in most other available languages (probably all of them, but I haven't checked some yet).
Now because you're using such huge numbers that bash can't handle, we have to use tools like bc or awk. But even the few solutions that do this entirely with bc/awk (naive approach) either pass in 11-12s, or time out. That is too strict IMO. You either have to pray that your implementation is good enough, or resort to using some kind of formula to speed it up, which isn't required for other languages.
I'm not sure what makes you ask that, because it shouldn't be. The code you posted is missing a few brackets (check the syntax for do-while loops), otherwise it passes all tests.
Surprisingly similar solutions :D
This comment is hidden because it contains spoiler information about the solution
Your main idea is incorrect. You may need to return a different string from the original one. Try looking for another approach.
Approved.
This comment is hidden because it contains spoiler information about the solution
I believe I fixed the issue that a solution can generate multiple solutions with the same value. Please try again.
You should clarify whether a sentence can begin with "quack" and whether it's capitalized or not.
No random tests.
Yes, this kata is horrible, but you need to use the formula exactly as it is in the description. Yours is missing a pair of brackets.
Loading more items...