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.
You can look up the 1 to n math formula. When you learn sums of series in school you often learn the 1 to n formula and you have to reorginize it with two variables to get from a to b.
I ran into this too. Looks like it says new array in the problem statement.
shouldn't the condition i < numbers.size() - 1 be enough to check for the size being <= 1. The for loop shouldn't run at all in that case and the empty vector would get returned. I find the need for a redundant check case confusing. It would seem to me that this is a bug, or an idiosyncrosy of how codewars treats c++?
This comment is hidden because it contains spoiler information about the solution