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.
look like chatgpt's solution
That's genius!
AHAHAHA, nice
AFAIK, it's because i64 implements the trait Ord, which contains those methods.
I did the same, but what if
n = 2_147_483_647
?If you add or subtract zero, the result will not change, but there will be no unnecessary operation.
I also summed it up with zero.
your brain is the compiler
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Nice solutions.
how is this the "best practices". I so don't get people on codewars...
It should panic, according to the description that's an invalid input.
If you enter 11 the code will panic. I don't think this is a "best practice."
Great calculations! Awesome))
Would you mind to elaborate? It's almost the same solution in C.
Loading more items...