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.
fixed
closing as this particular behavior is indeed mentionned
should be fixed
dnsvee is right, you need to nul-terminate the char array for it to be a valid string.
Approved. Thanks!
maybe the description should specify that the string only contains ASCII characters ? most solutions would be wrong for multibyte (Rust, C++) /UTF-16 strings (Java, JavaScript, C#...)
done
done
added all 3 to JavaScript
fixed
C:
typedef
of an incomplete type is not done properly:is not standard C (empty structures are forbidden). The correct way to refer to an incomplete type is by virtue of a forward declaration:
fork fixing both
no answer from OP
please, asking for help is not a kata issue, ask a question instead and format your code correctly: https://docs.codewars.com/training/troubleshooting/#post-discourse
your line
num - 1
has no effect. it computesnum - 1
and then discards the result, this is why your code never ends, sincenum
never changes.num = num - 1
akanum -= 1
would ensure thatnum
is decrementedIs the second criterion actually enforced ? Or even enforceable ? My own solution does not explicitely take care of it, I'm not sure whether it's because PostgresSQL produces a stable sort as an implementation detail (since the SQL standard does not make such a guarantee) or whether it's a consequence of using
regexp_split_to_table()
i tried to improve the assertion messages, and added some input validation. if you want to train on this improved version, save your code somewhere, click the RESET button, and paste back your code.
Loading more items...