You need to sign in or sign up before continuing.×
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.
You are right, indeed. Having gained some experience since the time I posted the solution, I would change the variable "new" to something like "translated", and the function name "dictionary" to "translate_leet". Thanks for the tipps!
Very bad practice to name a variable as 'new' which even if is not a C keyword, it is keyword from C++ to whom should be kept compatibility, almost always. Also dictionary is not suggestive enough and it may be ambiguous.
I was not aware of memory leeks back then :) I am now
what about memory leaks?
Thanks!
Solved it, but I am still curious why this was an issue.
When I allocated space for the result string, I have replaced
char *str = (char*)calloc(400, 1);
with
char *str = (char*)calloc(200, 1);
and it passed the last (random) test.
Great Kata!
Hi! My solution (in C) passes all the tests, except the final, random one(it gets an incorrect result with many weird characters in it).
However, when I run the code inside CLion, it gives me a correct answer for that random test.
What could be the problem?
This comment is hidden because it contains spoiler information about the solution