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.
The same issue :/
text = "7rc4F3z1QVNWp9CN", duplicateCount(text) should equal 3. 2 is not equal to 3.
Expected:3
Actual:2
Where is the third?
realy good!
approved with fix.
i32
tou32
The best
The same trouble.
"j6X2uPtwNluGqqVyAGVURCSwWBZHkWaIxzsamyEf2N4xjBMvo5I7icrVZpeRX5jqqrheXo4u6Gym7NSUkja0G" - expected 25, my result 27
"k0D9FXVzR9Pua6RXoM9yRFc4osh0MQWNVOrxoQwXdlqkntbYmopB7utSm7FcPY3QtGthJN2gI" - expected 22, my resul 23
"kwNYz9JLtOiFcEmHiINTKoOFHhbbDKnddG4Lqu09c2koyMoGbkbbhnXEMLKAxr9Sk" - expected 18, my result 17
Fixed. Thanks for reporting.
Thanks!
I keep doing the same thing if the first thing I would do would be to make an exact copy. The thing is the argument passed by value is just your local copy and you can do whathever you want with it without having it an effect for the caller. For the caller it matters little whether you take const & and do a copy explicitly or take argument by value. No changes are visible outside of a function.
On x86_64 Linux (this case I presume) size_t is usually typedef for unsigned long. So sizeof(size_t) will be 8 and sizeof(int) will be 4. With size_t you need store how big something is in memory, so it's unlikely be shorter than int anywhere, but it's still wasting memory. At least half of that diffArr array is always empty. That cast from malloc is not needed in C either as (void *) is implicitly converted to any kind of pointer (Unlike in C++).
Thanks for the Kata! It brings back memories. I haven't seen Pascal for like 18 years. :-)
i have the same issue.
in the ide of codewars, my code identifies n-1 duplicates in the string
whereas I ve compiled it with the random case string in a .c on my terminal and the same code identifies n duplicates (as would be needed to pass the last random case).
I m quite uneducated in the matter, my 2cents would be a compiler finesse.
I ll keep learning.
Yes, you're right. Fixed it.
I'm absolutely unable to pass random tests for D. It tells me for example:
But no matter how am I counting I'm unable to find a mistake. I'm looking for duplicate case-insensitive alphanumeric characters. What am I missing?
When it comes to D version, it seems to me, that the sample tests are missing two imports
import solution : findShort;
andimport std.string : format;
. Main tests are fine.Loading more items...