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.
The expected output is a single string with each row separated with line break.
You need to join your list.
Oh.... Ok I got it. Thanks
You wrote the answer in the question. 6=1, 12=2, 18=3 ... Try to figure out the logic of these equations
In the example, input 6 = 1 line full of ■,
input 12 = 2 ■ lines,
input 18 = 3 ■ lines.
Why? Is there any special rules for those ■ lines?
At first I solved this kata pretty fast, so I tried to shorten my solution to 1 line with logic operators.
Then I gave up after struggling for over 3 hours. This is really hard..
ok nevermind I solved it, this was really simple and I thought the question overcomplicated.
We cannot help you without more elements. We don't know what you are actually doing. This kata has been solved more than 10000 times in C#, so it's likely to be an error from your code. There may be differences between the implementation of your IDE and the one on CodeWars but that's not a kata issue: issues are bugs in the kata. I advice you to read this documentation: https://docs.codewars.com/training/troubleshooting/
This comment is hidden because it contains spoiler information about the solution
thanks for the comments; specifications have now been added to the solution setup
Nevermind, I solved it!
for those who are stuck at free() error: you should use malloc when defining the return array.
ok I found out some working codes for C after suffering for 3 days, but when I test this code it works and crashes at the same time and shows this:
Test Crashed
Caught unexpected signal: 6
free(): invalid pointer
Deleting free makes my solution work, so maybe the "free" thing at test code is a problem but I can't figure out what should I do.
I'll post my whole code on reply if it is needed.
Can someone help?