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 kata made me RTFM and learn about classes and dunders in Python :D
it just looks funny to me :)
This comment is hidden because it contains spoiler information about the solution
Don't know what're you talking about, kata seems fine for me. I would add "don't use strings" as an additional requirement (That is what people do in similar python katas)
Don't know what you're talking about, kata seems good enough for me. I would add "don't use strings" as they do for similar python katas :)
Thanks for you comment! I used static cast to explicitly show that it will be int. As far as I know it has no impact during runtime, i.e. check performed only during compilation.
As for lambda, I use it in C# a lot, but C++ is a mishmash on its own, so this was again for clarity reasons. Besides I don't have a foggiest idea how lamda works in C++ "under the hood" :)
Awesome kata! Thanks g964!
It seems comparing my own solution against other's makes the biggest difference for me!
I spend almost equal time to solving AND tracking other solutions!
And had to tackle std::chrono to find out if there are any performance boost at all :D
Hi!
Put character into single quotation marks, like this '*'.
Then compiler will count it as single char.
Double quotation marks, like this "*", means that you have a C-string char* containing 1 symbol.
Me too. All heil to the commented snippets! :)
Cool kata, I enjoy it very much! Thank you!
Btw, I think if you want to enforce people not to modify array parameter, you might consider to declare it as const.
Tho nobody prevents the coder to modify arguments while solving the kata :D
This comment is hidden because it contains spoiler information about the solution
Hi there! It seems there is a roudning bug either in my code or test case, in particular the test that gives "104" as a result.
In my solution I've explained it right next to the line that helps to overcome the bug.
Can someone point out what I did wrong? Thanks :)
This comment is hidden because it contains spoiler information about the solution
Cool task!
Spent almost 2 hours to solve this one in C++ (which is terribly slow I guess), but now I have a firm grip on <algorithm> and <numeric>! Or at least now I know what they are for :D
Took me a while to wrap my head around the description tho.
Nevertheless, g964 you have my gratitude!