fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. string s;
  7. cin>>s;
  8. string ss="hello";
  9. int i,k=0;
  10. for(i=0;i<s.size();i++)
  11. {
  12. if(ss[k]==s[i])
  13. k++;
  14. }
  15. if(k==ss.size())
  16. cout<<"YES";
  17. else
  18. cout<<"NO";
  19. return 0;
  20. }
Success #stdin #stdout 0s 4448KB
stdin
hhheeeehhhllloooo
stdout
YES