Why is my code showing SIGSEGV error. problem code ERROR

#include <iostream>
using namespace std;

int main() {
	// your code goes here
	int test;
	cin>>test;
	
	while(test--)
	{
	    string a;
	    int i, l=0;
	    cin>>a;
	    
	    for(i=0; i<a.size()-2; i++)
	    {
	        if(a[i]=='0' && a[i+1]=='1' && a[i+2]=='0')
	         {   l=1;
	            break;
	         }
	        else if(a[i]=='1' && a[i+1]=='0' && a[i+2]=='1')
	        {   
	            l=1;
	            break;
	        }
	    }
	    
	    if(l==1)
	        cout<<"Good"<<endl;
	    else 
	        cout<<"Bad"<<endl;
	}
	
	return 0;
}

@iamol_aggarwal - can you provide the problem code please. Also - you can click on the doubt support tab of the problem and one of the doubt solvers can help you resolve this.