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.
Oh.... Ok I got it. Thanks
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.
This comment is hidden because it contains spoiler information about the solution
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?