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.
Forgot that the "character" was actually a string. Ugh.
Nice going, wizard.
Way more beautiful slice solution than what I did. I regret making my solution operate on the list in-place.
geez, so smart
You should think for yourself, not in my place.
This code doesn't follow typical styling, which would have the line broken into a couple new lines and helps dramatically with readability. I think some believe one-liners look cooler.
Man I think they jumped the gun giving me kata lvl 6. Losing confidence but to disciplined to stop trying!
This is character for character the exact same solution that ChatGPT gave me, so congrats to everyone who arrived here on your own. My solution was much clunkier.
So far yes. First use maths, then programming as they say :)
I ran this through compiler explorer alongside others' answers and my own. With compiler optimizations maxed, this solution required the fewest instructions by a few hundred lines and it caught me off guard! I wonder why.
This solution is faster and better memorywise than others, right?
The solution I tried to implement, but because I didn't know about
cloned()
method had to go with clonning input array into variable -__-This one blows my mind
I've searched all over the place to find mathematical proof of how this dead-simple algorithm works, but it's seemingly magic lol
I had come up with a pen-and-paper way to construct the partitions by laying them out in a left-aligned triangle and summing up offset diagonals to produce new terms, but couldn't figure out how to put that to code
This algorithm seems to resemble that triangle idea, but instead only needs a single row of numbers, and it doesn't seem to even remotely relate to partitions, yet it works lol
If the only odd element in the array is i32::MAX, the function returns false.
interesting code, but it doesn't seem to like when n == 0.
Loading more items...