my code has passed all the test cases but for custom input n>=11 it is not following the regular pattern⦠why???
#include
using namespace std;
int main() {
int n;
cin>>n;
for(int i=0;i<=n;i++){
int a=n;
for(int j=1;j<=i+1;j++){
cout<<a<<β β;
aβ;
}
for(int k=1;k<=n-i;k++){
cout<<β β<<β β;
}
for(int k=1;k<n-i;k++){
cout<<β β<<β β;
}
a=n-i;
if(i==n){
for(int j=1;j<=n;j++){
cout<<j<<β β;
}
}
else{
for(int j=1;j<=i+1;j++){
cout<<a<<β ';
a++;
}
}
cout<<endl;
}
for(int i=1;i<=n;i++){
int a=n;
for(int j=1;j<=n-i+1;j++){
cout<<a<<' ';
a--;
}
for(int k=1;k<=i;k++){
cout<<' '<<' ';
}
if(i!=1){
for(int k=1;k<i;k++){
cout<<' '<<' ';
}
}
a=i;
for(int j=1;j<=n-i+1;j++){
cout<<a<<' ';
a++;
}
cout<<endl;
}
return 0;
}