#include <bits/stdc++.h>
using namespace std;
bool go(vector<int> &people)
{
int lastPos = -100;
for (int i = 0; i < people.size(); i++)
{
if (people[i] == 1)
{
if (i - lastPos <= 6)
return false;
lastPos = i;
}
}
return true;
}
int main()
{
int n, t;
cin >> t;
while (t--)
{
cin >> n;
vector<int> people;
int temp;
while (n--)
{
cin >> temp;
people.push_back(temp);
}
cout << (go(people) ? "YES" : "NO") << endl;
}
}
This is my code. Can someone point out why am I getting this error?