Pattern double sided arrow?

pls correct my code my code fail in sevral testcases and also correct my code
#include
using namespace std;
int main() {
int n;
cin>>n;
int k = n/2+1;
for(int i = 1;i <= k;i++){
for(int space = 3k-4(i-1);space>0;space–){
cout<<" “;
}
for(int j = i;j>0;j–){
cout<<j<<” “;
}
if(i>1){
for(int space = 1;space<3+4*(i-2);space++){
cout<<” ";
}

    for(int j = 1;j<=i;j++){
        cout<<j<<" ";
    }
}

   cout<<endl;


}
 
 for(int i = 1;i <=k;i++){
     for(int s = 1;s<=k+4*(i-1);s++){
         cout<<" ";    
     }
     for(int j = k-i;j >0;j--){
         cout<<j<<" ";
     }
     
     if(i < 3){
         for(int s = 1;s<=n - 4*(i-1) - 1;s++){
        cout<<" ";    
     }
    for(int j = 1;j <= k-i;j++){
         cout<<j<<" ";
     }
     }
     cout<<endl;
 }
return 0;

}

Hi Bhavya Kshitiz!
Please check the following code, your code is 70% correct, but there were some errors in the loops.

Thanks!

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

pls correct my code, my code was giving right output in devc++ but when submitting the hackerblocks it gives wrong output.
#include
using namespace std;
int main(){
int n,v,t;
cin>>n;
int j=n-1;
int space2;
for(int row=1;row<=n;row++){
if(row<=(n/2)+1){
int p=row;
for(int space=1;space<=j;space++){
cout<<" “;
}
j=j-2;
for(int colm=1;colm<=row;colm++){
cout<<p<<” “;
p–;
}
for(int space1=1;space1<=row-1;space1++){
cout<<” “;
}
space2=row-1;
for(int space4=1;space4<=space2-1;space4++){
cout<<” “;
}
for(int no=1;no<=row && row!=1;no++){
cout<<no<<” “;
}
}
else{
for(int space=1;space<=j+2+2;space++){
cout<<” “;
}
j=j+2;
int m=row;
int v=row-j-2;
t=v;
for(int colm=1;colm<=row-j-2;colm++){
cout<<v<<” “;
v–;
}
for(int space3=1;space3<space2;space3++){
cout<<” “;
}
space2–;
}
for(int space5=1;space5<space2;space5++){
cout<<” “;
}
for(int no2=1;no2<=t;no2++ ){
if(t!=1){
cout<<no2<<” ";}
}
cout<<endl;
}
return 0;
}