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.
.
Old kata syndrome, re-ranking them is not possible now due to the excessive amount of solutions that is associated with legacy code in DB, but it will be addressed soon as admins and the CW team are aware of this ^^
I am having issues with indexing, my logic should be correct but it still gives the wrong answer, anybody notice some stupid mistake i might be making?
why is this kata so high level, was not 5 kyu difficulty kata imo.
Thanks for the response, i knew about that integer thing but didn't use it.
some mistakes that i see:
size
bytes, but then you accessret[size]
, this is an out-of-bounds access, the last character is atret[size - 1]
ceil(n / 2)
is equivalent to justn / 2
, since you are diving 2 integers\n
), but you are not adding oneThink i am making a mistake somewhere but i don't know where, any suggestions or possible mistakes i could have made. (in C)
r
,g
andb
can be negative. The format"%x"
takes an unsigned integer as input, so you are printing a very large number after reinterpretation of the signed int as un unsigned int. Since the output string has enough room for 6 characters + 1 nul terminator, you are writing out-of-bounds, which causes chaos in the tests suitsprintf(h, "%c", '\0');
appends 2 nul characters to the string, becausesprintf()
always nul terminates its target string after finishing the printing. same problem as above, you are writing out-of-boundsSolution worked on other IDE but here returns "r = 0, g = 0, b = 0 expected "��E�H�� ]�fD", but got "000000"" witch is more than confusing.
Anyone else had the same issue if so what is the fix, i think i'm messing with the memory addresses that the test function uses.
(in C)
simple as that... nice one