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.
the "units of measure" crate uom would be a nice fit also, but it's not available here
Damn, I completely forgot about bitwise operators! Nice solution bro.
Nice code
oh sorry, will do! thanks
Please use spoiler flag next time. The comments to solutions are visible from the dashboard.
This comment is hidden because it contains spoiler information about the solution
Yes sometimes using memory in the right way (when input data allow it) can greatly optimize a program like tables of sinus in ancient architechtures which hasn't got any mathematical processor.
who voted best practice on this xD
Well i guess in some circumstances this would be the safest bet (system with ROM?)...
for testing i used this kind of method as well, i admit it
wow, this is something... took me like 3 times as long to understand this code than it took to write my own solution :D
Are people really writing this kind of code for production?
You could use a match on the comparison, this way you don't have "i if ..." (that would be clearer to read). But just a suggestion :)
Alternatively you could just use a simple if {} else {} of course, as you just want to distinguish exactly two cases.