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.
I don't know about your solution, but with C this is not uncommon to happen. This sometimes happens due to undefined behavior (UB) coming from your solution and influencing the tests. I was told that it's difficult / impossible to combat this from tests' side.
I only wrote code for returning words count, the array function words_to_array is empty.Solution got aproved. It does not check the array?
but you should specify what the problem actually is, because I'm not seeing it ( granted, I don't know much C ).
should mark this as an issue
You need to return this result, not print it to console.
Using python 3.11, getting the following results.
Test Results:
Fixed Tests
Basic Test Cases
Log
S.H
None should equal 'S.H'
Log
P.F
None should equal 'P.F'
Log
E.C
None should equal 'E.C'
Log
P.F
None should equal 'P.F'
Log
D.M
None should equal 'D.M'
This comment is hidden because it contains spoiler information about the solution
Missing empty strings and one-word string (no spaces) in sample && fixed tests of
CS
Crystal
C#
D
Elixir
Go (Only empty string test is missing)
Java
JS
PHP (Only one-word string test is missing)
Racket
Rust (Only empty string test is missing)
TS
Description is now language-agnostic, so closing
This is out of the specs of the kata, closing
Forked and approved
Yeah you Right about all that.
Thank you for all, I will still work on solution to find it.
Again Thank you
btw, you have an off-by-one allocation error there: you need 5 bytes to store
"word"
, don't forget the nul-terminator that marks the end of the string:{ 'w', 'o', 'r', 'd', '\0' }
yeah, it's complicated to provide better feedback because in C you usually cannot check whether a given pointer is valid or not. so the tests will compare the random pointers in
words_array
and it's likely to lead to a segfault.that being said, i just updated the tests to be more user-friendly:
words_array
will be initially filled withNULL
pointers; and the tests will handle thoseNULL
s safely for both comparison and composing the assertion message. your code no longer crashes now.I know, but the problem in the terminal
I allocat 1 block of 4 bytes to test the "word" but I think when the compare he return my arr with element that I enter manually when is not same. Like "wor" but instead when I enter "word" complet he give me Invalid memory access
Loading more items...