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.
this is a nice kata. repeat function is a good idea!
Prolog:
The true answer is around
239.235262893700738
, the reference solution is too far from it.I've searched for the switch statement in Python and found that it does not exist.
Instead, it's called the match operator, which has been available since Python 3.10.
This solution is very clear using the match operator, and it also uses string interpolation and collection destructuring/unpacking.
I've trained again on this kata to type and feel for myself the functioning of this operator.
very clever man
I see now. Many thanks!
Had no idea PHP has cheat codes like this
This is a simple check for a divisor without a remainder, no more.
exactly, my opinion is to know solutions from external modules, but more importantly, to actually put your hands on constructing a complex versions that has all the core problem solving steps.
Can somebody explain me, please, why this works if only are checking base%factor and not with inverted positions? In case of 2 and 6 this would give false even they are factorials if you invert the base and factorial. Thanks...
wait what? lol
If the input string, with leading whitespace and possible +/- signs removed, begins with 0x or 0X (a zero, followed by lowercase or uppercase X), radix is assumed to be 16 and the rest of the string is parsed as a hexadecimal number.
If the input string begins with any other value, the radix is 10 (decimal).
Aight, thx for the answers. I'll need to read all that quite a few times and let it cook a little.
It is slower (in regards to time complexity) in some specific cases, compared to solution where we compare each element to the saved value and then return instanly when the mismatch is found. In this solution you always have to loop through the whole array at least once.
๐๐
i cannot find when in the Revisions page, but it looks like it got fixed at some point; i only see one call and it's not within a loop. but feel free to check in case i misunderstood the issue
Loading more items...