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.
du dumma hua
I really appreciate both comments, I had no idea I could just do what I thought that was the most practical in a specific situation and not just follow a rule that a professor told me. Thank you!
What your college was teaching you is wrong:
https://cseducators.stackexchange.com/a/4428
Besides, nobody takes these as actual "rules" that has to be followed in practice. The real answer is always "it depends", and caring about petty details like this makes you lose sight of the bigger picture and, hence, always end up with worse things.
that's essentially true when one is spreading the return statements in the middle of somewhat "big" blocks of code. For a so short function, the main drawback is not to have multiple "return"s but the amount of typing that generates!
This comment is hidden because it contains spoiler information about the solution