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.
Plus, pasting any code which could be a solution should be checked off as 'mark as having spoiler content'. It also helps to format it for readability for others using the three opening/closing backticks.
you can achieve with 2 conditionals and a loop
You can check why your code does not work by running it in your IDE locally for some value, for example 77.
Your loop is returning at the first iteration, so it isn't working as a loop at all.