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.
Given that the task is very specific I'd say it is, as it is performant and the code is readable.
If you had to, for example, generate neighbors up to a variable distance
n
received as a parameter of the function, that would be a different story.cool~
Note that 1^3 + ... + n^3 = (1+ ... + n)^2 is not true
1^3 + ... + n^3 is 1/4 n^2 (1 + n)^2
Yep, thank you. It's right.
You should check the result when you have finished computing - this code doesn't return -1 if m=4.
You can to add simple test case "()(" - is invalid, for C++. Without it, I committed invalid solution. =)
This comment is hidden because it contains spoiler information about the solution