My issue
//why is this not working ??
//eg for array size 5
// pref and = 1 1 1 1 0
// pref xor = 1 0 1 0 0
//suff and = 0 0 0 0 0
// suff xor = 0 1 0 1 0
include <bits/stdc++.h>
using namespace std;
int main() {
// your code goes here
int t;
cin >>t;
while(t–){
int n;
cin >> n;
for(int i=0;i<n-1;i++){
cout << 1 << " ";
}
cout << 0 <<endl;
}
}
My code
#include <bits/stdc++.h>
using namespace std;
int main() {
// your code goes here
int t;
cin >>t;
while(t--){
int n;
cin >> n;
for(int i=0;i<n-1;i++){
cout << 1 << " ";
}
cout << 0 <<endl;
}
}
Problem Link: Prefix Suffix Inequality Practice Coding Problem