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.
If p points to anything then it cannot be a null pointer because it pointed to something!
meow meow
thanks for the feedback, there was a function name written wrong. now everything should be fine
This comment is hidden because it contains spoiler information about the solution
@meonu, because
x
can become very large given largenum
In cases ilke this, I mostly put the parentheses in to remind myself about the precedence of the '' (in partucular).
There are several problems with your approach:
malloc(strlen(str))
doesn't allocate enough space for the string and the terminating'\0'
.p[i]
andp[j]
you only convert the first one to lowercase.DuplicateEncoder("aA")
andDuplicateEncoder("AA")
should both return"))"
.*(res + i)
accesses unknown data, possibly even a')'
.Also, why the complicated
memset(res + i, ')', 1);
instead ofres[i] = ')';
?Correct.
val >= 0
is not correct ;-)And there are other things you need to fix too.
"My code doesn't work" is a question, not an issue ;-)