I have solved the problem but all test cases have failed.
then i watched the solution video and it was same what i submitted. I tried again and again still all test cases are failing.What to do?
this is my code
#include
#include
#include
using namespace std;
vector targetzero(int n){
vectorv;
int n1=floor(n/2.0);
for(int i=1;i<=n1;i++){
v.push_back(i);
v.push_back((-1*i));
}
if(n%2==1){
v.push_back(0);
}
return v;
}
int main(){
int n;
cin>>n;
vectorans;
ans=targetzero(n);
for(int i=0;i<ans.size();i++){
cout<<ans[i]<<" ";
}
}
