Can Some please help. Getting TLE


#1
vector<vector<int> > Solution::generateMatrix(int A) {
int size = A;
vector<vector<int>> a( A , vector<int> (A, 0));
int fill = 1;
int r = 0, c = 0;
int n = size, m = size;
while(r<n && c<m)
{
    for(int i=c;i<m;c++)
    {
        a[r][i] = fill;
        fill++;
    }
    r++;
    for(int i = r; i<n;i++)
    {
        a[i][m-1] = fill;
        fill++;
    }
    m--;
    for(int i = m-1;i>=c;i--)
    {
        a[n-1][i] = fill;
        fill++;
    }
    n--;
    for(int i = n-1; i>=r;i--)
    {
        a[i][c] = fill;
        fill++;
    }
    c++;
}
return a;

}