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.
I for the love me can't understand how this one ain't the most upvoted both as clever and best practices
hats off for avoiding regex altogether, I tried the same and had 10x the numer of locs
This comment is hidden because it contains spoiler information about the solution
Good point, I don't remember if I did this for a good reason, but given that I initialize bits to 0 I think that & may be superfluous.
This comment is hidden because it contains spoiler information about the solution
Great point, I swing languages very often and some don't have that notation so that betrayed me here
For the C version:
It didn't but Rust is very picky about type conversions, u32 is what https://doc.rust-lang.org/std/char/fn.from_digit.html takes. You can cast with "as" but it is not ideal. If this causes problems to existing people who passed the test then I agree that we shouldn't change it.
In Rust (and any strongly typed language really) the digit should be unsigned