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.
languge C, don't modify input array.
Why for n = 6 expected 3?
Array = {4, 8, 12, 12, 3, 6, 2}
Submitted: 0
Expected: 3
Log
n = 2
1 1 3 3
res = 4
n = 4
1 1 5 6 9 16 27
res = 3
n = 6
4 8 12 12 3 6 2
res = 0
Thanks for answer!
It was my mistake: empty input srting was reason of problem with memory.
C, use malloc() and free() for memory.
This comment is hidden because it contains spoiler information about the solution
Hi everyone!
Solution passed all sample tests, works fine in IDE, but when I try attempt I get next error in one of tests:
Test Crashed
Caught unexpected signal: SIGSEGV (11). Invalid memory access.
How can I get string, which crashed test?
Thanks!
"aabBcde" -> 2 # 'a' occurs twice and 'b' twice (
b
andB
)