i have little knowledge about SIGABRT, so i checked my code for infinite loops and memory overflows, and corrected two mistakes, but still i get the same error when i submit it on spoj…
The reason for SIGABRT here is not because of consuming too much memory. The faulty statement is on line 23 in your code: “if(10*(s.at(len-2) -‘0’)” here, suppose value of len for some case is 1, then the statement will refer to s.at(-1) which causes the SIGABRT error here. Correct it by putting a condition for len<2