Must do Pattern q22

PHOTO EMBED

Sat Jun 22 2024 14:53:33 GMT+0000 (Coordinated Universal Time)

Saved by @Xeno_SSY #c++

void getNumberPattern(int n) {
    // Write your code here.
    for(int i=0;i<2*n-1;i++){
        for(int j=0;j<2*n-1;j++){
            int top=i;
            int left=j;
            int bottom=(2*n-2)-i;
            int right=(2*n-2)-j;
            cout<<n-min(min(top,left),min(right,bottom));
        }
        cout<<"\n";
    }
}
content_copyCOPY

4444444 4333334 4322234 4321234 4322234 4333334 4444444 cout<<n-min(min(left,top),min(right,bottom));