Pattern mountain challenge

#include<bits/stdc++.h> using namespace std; int main() { #ifndef ONLINE_JUDGE freopen(“input.txt”, “r”, stdin); freopen(“output.txt”, “w”, stdout); #endif int N; char k; cin>>N; char mat[N][2N-1]; for(int i=0;i<N;i++){ for(int j=0;j<(2N)-1;j++){ mat[i][j]=’ '; } } int row,col,j; for(row=0;row<N;row++) { for(col=0,k=‘1’;col<=row;col++) { mat[row][col]=k++; } } for(row=0;row<N;row++) { for(col=(2N)-2,k=‘1’;col>=(2N)-2-row;col–) { mat[row][col]=k++; } } for(int i=0;i<N;i++){ for(int j=0;j<2*N-1;j++){ cout<<mat[i][j]; } cout<<endl; } return 0; }

the ouput is coming correct but all the testcases are showing wrong answer.