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