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.
I still recommend adding something about null-terminated strings (or C-strings) to the title to avoid confusion. This kata isn't really about the general concept of strings in informatics; it's focused on a specific type of it.
I prefer to maintain const-clarity: everything intended to be constant, I explicitly declare as constant. It's a habit, much like fastening a seatbelt, 99.9% of the time, it may seem unnecessary, but that one time it matters, it can save your life. Besides, it costs nothing to just type one extra symbol.
This comment is hidden because it contains spoiler information about the solution
I did what you ask. No need for a reference solution
Also, I increased the number of test to 500, so the probability of getting every length from 1 to 50 is ~99.8% (before it was ~0.02%).
It's 7 kyu kata, I don't think there's a need to make it more complicated than it already is
Is this a question? The short answer is probably "no".
The long answer is that tests are specifically written to avoid 64 bit overflow, so the answer is probably "no".
You are free to do or return whatever you want inside (and sometimes even outside) of the function, as long as the function signature stays the same
Do your magic, wizard :^)
Все тесты корректные, внимательно читай условие задачи, в частности, последний пункт.
Ah, okay.
@o2001 I think while translating this specific kata to C++ it happens to be one of these cases where it would be better to just keep the signature it as is. After all, C++ does have null-terminated strings, and this kata is focused primarily on them, not strings as a concept in general.
Also, we have this kata, which is specifically made for C and descendents of C. I think if following the example and adding something about C in the title would help to avoid this problem.
Just yell at people for translating to any language that has no null-terminator and reject, as we already do with BF translations
@Wizardll o2001 alredy kindly handled all issues in his fork. Please, review it.
@Wizardll you're still not following guidelines. Just review this fork, please.
Not particularly a critical issue, but adding assertion messages to C++ would not hurt.
Loading more items...