58A - Chat room Codeforces || Codeforces 58A - Chat room Solution

Problem Name: 58A Chat room
Judge: Codeforces
Problem link: 58A Chat room



Codeforces 58A - Chat room Solution in C++/Cpp

#include <iostream>
#include <string.h>

using namespace std;

int main()
{
    string s, word = "hello";
    cin >> s;
    int count = 0, point = 0;
    for (int i = 0; i < word.length(); i++)
    {
        for (int j = point; j < s.length(); j++)
        {
            if (word[i] == s[j])
            {
                count++;
                point = j + 1;
                break;
            }
        }
    }
    if (count == 5)
    {
        cout << "YES" << endl;
    }
    else
    {
        cout << "NO" << endl;
    }
 
    return 0;
}












Tags: Codeforces 58A - Chat room solution in C C++, 58A codeforces solution in C C++, Codeforces 58A solution in C C++, Codeforces Chat room solution in C C++, 58A - Chat room Codeforces solution in C C++, Codeforces 58A - Chat room solution in C C++

Next Post Previous Post
No Comment
Add Comment
comment url