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.
look at the basic operator types, if you did what I did you probably have type issues instead of rounding issues. i.e. look at integer division instead of the division operator that returns a float.
Looks fine to me now?
Do you mean, O(n) iterations through the source_code string? That gives you O(n2).UPD. My bad, I've got your idea just now. It seems to be optimal enough, but there may be small hateful bug, which makes you suffer.
P.S. Finally there is one solution (except mine), so I believe that kata is solvable.
It takes at most 2 seconds to test my solution (I've tested it right now - it took 1364ms).
If you cannot pass the performance tests section, probably your code isn't optimal enough. What is time complexity of your solution?
Also, big output may be caused by the error in the solution. 'DoTest' function tries to output actual and expected results, which can be quite large.
I have the same problem.
The example tests are ok, but the complete tests can never be done. It seems the problem with the performance of the tests (too big, too much for the codewars resources).
Not only C++, the descriptions for all languages are currently broken.
This comment is hidden because it contains spoiler information about the solution
Haha... It was the first thing that came to mind, wasn't expecting people to read my code...
@simonvpe
: never post your code without thespoiler
flag activated. ;)(I flagged it)
Please feel free if you are so inclined. I'm always interested in performance comparisons and learning a bit more about optimization.
This comment is hidden because it contains spoiler information about the solution