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.
You initialize the depth variable in the loop but reuse it outside the loop.
It work for this exercise in this language but in some language the variable would stop existing after exiting the loop.
For avoid this kind of error, it may be more wise to initialize your depth variable before the loop.