We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Here's why your C code is not working. You are not allocating enough memory to the buffer for processing the input. The 6th test case is about 36K characters. Have scalability in mind from the start, or your code will choke when you get a more realistic data set to process.
I allocated 2MB and everything was fine. This may be overkill for the problem, but it works. A lot of test cases for C/C++ will be failed if you don't consider that the site might throw a huge set of data at you in the test suite.
CamelCase
You are viewing a single comment's thread. Return to all comments →
Here's why your C code is not working. You are not allocating enough memory to the buffer for processing the input. The 6th test case is about 36K characters. Have scalability in mind from the start, or your code will choke when you get a more realistic data set to process.
I allocated 2MB and everything was fine. This may be overkill for the problem, but it works. A lot of test cases for C/C++ will be failed if you don't consider that the site might throw a huge set of data at you in the test suite.