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.
Yes, you can use a break clause in order to stop the loop.
But, in my opinion, breaks and gotos are not a "good practice".
You could also place the return statement after the "missingLetter+=1" (this is the line that you use for find the correct number of the letter).
Another option, you can use booleans. You can declare a boolean found = false; at the beginnig, use it in the loop (for(int i = 0; i < array.length-1 && !found; i++)) and, when you found the letter, write found = true;
So, the next time you return to the loop condition, !found will be false, so yo won't enter again, and you save a lot of time.
I hope was helpful :D
Do you think it's efficient to use a 'return' clause inside a loop?
Would not it be better to use boolean conditions?
You are watching all array's elements, but you only need to see elements until you find the missing one.
If the array had had 1000 elements and the missing one was found in the 1st iteration, you would be doing an extra effort.
Use a boolean or similar :D.