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.
Points for being different, but this solution doesn't work because binary OR is not the same as ADD for all inputs. This shows the importance of good testing code. I assume it passed the testing that was available at the time.
This comment is hidden because it contains spoiler information about the solution
Thanks for this solution. I learned more about functional programming by studying it and getting a very nice piecewise explanation by Claude, the AI Chatbot. Since I'm not very familiar with this style, I tested this solution and found that it fails with a time-out at 12 seconds every time, which makes me wonder how it got on this list, except I'm glad it did. Buddy() is written to call sum(i) again if i<sum(i). If the sum(i) is saved and reused (oh no!), about 25% of the time is saved and the solution passes "ATTEMT" most of the time in 10-11.5 seconds. The solution with 12 or more votes for Best Practices, finishes in 2-3 seconds. Cheers.
This comment is hidden because it contains spoiler information about the solution
I had that thought too. But n has a fixed range and while m may be larger than the limit of the range, there are only a limited number of m's, one for one with the values of n.