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.
how do you find this formula?
never saw abs before) thanks
The function essentially inverts the sum formula to find the maximum n (number of levels) that can be achieved with the given number of balls. It's a direct application of the quadratic formula to find the integer solution for n in the equation n(n + 1)/2 = balls. The - 1 and / 2 adjustments are made after taking the square root to solve for n
Hi there! Is is possible for you to explain this line of code in a bit more human way? I am still very new to Swift and I would like to understand what actually does this abs, reduce(1,*) :)) Thanks in advance for that!