Getting a runtime error(SIGABRT) - MEXSTR

Hey community
I tried this question using this code. It’s a naive solution. But, I got a SIGABRT error.
Can anyone please help me why,where it occurred and how to rectify the same.
https://www.codechef.com/viewsolution/44526868
subs is for checking if a string(b) is a subsequence of the other(a)
bin is for converting to binary

Thanks in advance

why-do-i-get-a-sigabrt