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.
Syntax for classes more than actual OOP. So I would agree that 8kyu is not that far-fetched.
If you swap out exec with print, you'll see what is what is passed to the exec function.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
The task specifies "natural numbers", so negative numbers isn't a part of the task.
x can be subsituted with _ for an unused variable
A recursion is when a function calls on itself. This is one of the simplest forms of a recursion.
In this example we put a condition to do a recursion, but you can also do the opposite - to set a condition to break the recursion.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This kata had me for a second until it "clicked". Fun to compare the approaches to solve this one.