sstory runtime error

Plz someone help me debug this code…When I submitted it showed a runtime error(SIGABRT)…Plz can someone point out the error??This the problem link CodeChef: Practical coding for everyone
This is my solution link CodeChef: Practical coding for everyone

The problem is in your function where you are initializing your vector array.
As you know in worst case the length of the strings is 250000.

You are trying to initialize a 2-d array of size : arr [250000] [250000] ;

This is way beyond the memory limit .
Due to usage of too much memory in a function during runtime throws runtime error.

Also to avoid that you should declare such array globally , so that memory is given during compile time not runtime .But I don’t think that the approach you are using can solve the problem in given timelimit.