What's wrong with this solution?

I have been continiously getting SIGABART runtime Error on my this Solution for this Problem .

Got similar verdict on Chennai onsite as well :smiley:

Help me out Please!
Thanks :smiley:

Dear @code_hard123

SIGABRT errors are caused by your program aborting due to a fatal error. In C++, this is normally due to an assert statement in C++ not returning true, but some STL elements can generate this if they try to store too much memory.

Please check the memory limit of the problem. Generally in C++ the maximum memory limit is 256 MB.I think your code is storing to much data. To abort this error please avoid of using to many arrays, vectors and long long data types.

Edit:- I’ve seen your solution and I found a problem that is “arrays”. There are too many arrays.

**EDIT 2 : the memory limit for this problem is ony 50 MB. **

1 Like

Actually, you are getting this error because your solution is recursive + you are also passing the
string as argument, with recursion, which makes memory too high , don’t pass string as argument
with recursion , make it global( Error can’t occur ).

1 Like

thanks for the consideration :slight_smile:

Sounds correct! Thankyou :smiley:

//