Help me in solving EZSPEAK problem

My issue

I’ve successfully solved the problem and my test cases got passed in VScode but the same code in CODECHEF editor giving wrong Outputs. Can anyone please help me with this?

My code

#include <bits/stdc++.h>
using namespace std;

bool is_conso(char k){
    if(k==97|| k==101 || k==105 || k==111 || k==117){
        return false;
    }
    else
        return true;
}

bool is_consec(string s,int n,int j){
    if(j<(n-3) && is_conso(s[j])){
        if(is_conso(s[j+1]) && is_conso(s[j+2]) && is_conso(s[j+3])){
            return true;
        }
    }
    else
        return false;
}

void solve(){
    int n;
    cin >> n;
    string s;
    cin >> s;
    for(int i=0; i<n; i++){
        if(is_consec(s,n,i)){
            cout << "NO" << endl;
            return;
        }
    }
    cout << "YES" << endl;
    return;
}


int main() {
	// your code goes here
	int tc; cin>>tc;
	while(tc--){
	    solve();
	}

}


Learning course: 1000 to 1400 difficulty problems
Problem Link: Easy Pronunciation Practice Problem in - CodeChef

@shaship_16
plzz refer my c++ code for better understanding

#include <iostream>
using namespace std;

int main() {
	int t;
	cin>>t;

	while(t--)
	{
	    int n;
	    cin>>n;
	    string a;
	    int i=0,c=0;
	    cin>>a;
	  // cout<<a.length();
	    while(i<n)
	    {
	        if(a[i]!='a' && a[i]!='e' && a[i]!='i' && a[i]!='o' && a[i]!='u')
	        {
	            c++;
	            if(c==4)
	            {
	                break;
	            }
	        }
	        else
	        {
	            c=0;
	        }
	        i++;
	    }
//	    cout<<c;
	    if(c==4)
	    {
	        cout<<"NO"<<endl;
	    }
	    else
	    {
	        cout<<"YES"<<endl;
	    }
	}
	return 0;
}