Using strings in C++

Hi! I want to know that is it fine to use strings in C++ here?
I submitted my code to Chef Left Right problem but it gives me a wrong answer. Is it because of strings or am I missing test cases?
Is it necessary that every time I use a character array to take input?
Please respond.
Thank you.

Yes you can use strings in C++ here. There must be some bug in your code which is leading to wrong answer.

Please share the link to the code.

Why don’t you use use as char[memory_size]? … It would be better to use. Some says it’s a bug of all kinds but i don’t think so.