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.
Please use markdown to post your code next time ;-)
n == 0
: you need to return amalloc()
'ed string in each case. This is why the tests crash: they try tofree()
your returned string, but a string literal cannot be freed.Other mistakes:
i
starts at1
, but you printi + 1
to the string, so1 sheep...
is missingn == 10000
,"10000 sheeep..."
will be15
characters long, but you allocate only13
formur
and13 * n
formurmur
---> for largen
you will run out of memory and write out-of-boundsPlease mark your post as having spoiler content next time.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
See the example in the description, the input is not in the error message, the first value is your wrong answer, the one with less spaces in it and the second one is the expected answer, with double spaces.
This is the test:
I am sorry but the text is not being reversed; what i can see is only the addition of a space between the words
'elbuod decaps sdrow' = > 'elbuod decaps sdrow' (only the spaces added here)
look at the length and the individual bytes of your string - it does not work perfectly, you are not measuring correctly. granted, I can see how that would be confusing, but, it also seems like the sort of thing to watch out for in C with all the footguns available
The error message is:
Your solution does not preserve adjacent spaces.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
oh , that's really seem to be my bad , im sorry
Backup your code, click reset, and paste it again.
but why the default testcases are wrong ?
Loading more items...