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.
This breaks the problem down well, but the solution could be much simpler I think.
I'm quite a noob when it comes to improving my algorithms' performance and even more so because I'm quite new to C++, too.
My solution keeps timing which is okay in my opinion since the code indeed is super uneffecient. However, with quite a lot of testing I think that the output is actually correct - just too slow.
Can anyone suggest how I could possibly improve my code's performance? I don't really want a full solution or anything related to that.
don't std::cout << sum the result but instead use return sum; opposed to your return 0;
That's why you'll always get 'Actual: 0' because your functionw ill always return 0 in any case.