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.
This comment is hidden because it contains spoiler information about the solution
i did the same thing and it didnt work, so i just solved it the long way
There's no guideline saying how many return statements you should have. There used to be one, but in modern languages it's no longer applicable. The only practice is that control flow of your function should be clear, what means you should consider structure of your ifs, loops, try/catch blocks, their nesting, and, eventually, returns inside of them. But it's not a matter of numbers, but rather of layout.
It's perfectly valid to exit a function upon verification that it should not, or does not have to, perform any further work.
Besides, in your solution you have other things to worry about than an early return :)
Trust me it's kind of hard to understand what you are trying to point out, however I see your point through this code. This code work and well done!
This comment is hidden because it contains spoiler information about the solution