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.
Highly appreciate the comments in your solution.
As a complete newcomer to Rust, thank you for the comments! If only more people did this on Fundamentals kata instead of code golf!
Yes. The context is throughout the function including the parameters.
How Rust knows that you want parse the str into u32? From the function return type?
An important skill in software engineering is reading the requirements thoroughly.
It doesn't filter negative values; if we have -10 and -5 as inputs, this function would return 49.
This is really clever, I never thought of using the max method to filter out the negative values.