How to remove sigabrt runtime error?

For the practice(easy) question Sums in a Triangle -

why is my code giving sigabrt error? I’ve googled it and I am a bit confused. At some places it was given the error is raised on not deleting allocated pointer memory and at some other places it was written that deleting already deleted memory gives the error. Please tell me what exactly this error is and how should I remove it.

I’ve tried to solve the question using recursion. I believe that the code will give the correct answer as it is giving for the given test case and some of my own. I want to know about the sigabrt error and how should i remove it.

Here is my code. -

using namespace std;

int sum(int **matrix,int n,int i,int j)
        return matrix[i][j];
        int total=matrix[i][j];
        return total;

int main()
    int t;
        int n;
        int **matrix=new int*[n];
        for(int i=0;i<n;i++)
            matrix[i]=new int[i];
            for(int j=0;j<=i;j++)

@admin Please tell me the answer.!

@admin??? answer please…