Skip to content

Instantly share code, notes, and snippets.

@lazycipher
Last active January 16, 2023 05:55
Show Gist options
  • Select an option

  • Save lazycipher/3efeb9a58f875f27176e8932c3982df3 to your computer and use it in GitHub Desktop.

Select an option

Save lazycipher/3efeb9a58f875f27176e8932c3982df3 to your computer and use it in GitHub Desktop.
CodeForces 58A - Chat room Solution in C++
#include<iostream>
int main(){
std::string word, hello="hello";
std::cin>>word;
int j=0, pas=0;
for(int i=0; i<word.length();i++){
if(word[i]==hello[j]){
j++;
pas++;
}
}
if(pas==5){
std::cout<<"YES";
}else{
std::cout<<"NO";
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment