Hello Friends
Xem dạng PDF
Gửi bài giải
Điểm:
1,00 (OI)
Giới hạn thời gian:
1.0s
Giới hạn bộ nhớ:
256M
Input:
stdin
Output:
stdout
Nguồn bài:
Dạng bài
Ngôn ngữ cho phép
C, C++, Java, Kotlin, Pascal, PyPy, Python, Scratch
Nam loves chatting with friends on the Internet. He has set up a chat room with the condition that before entering the chat room, everyone must greet first.
A greeting is defined as a string of characters, consisting only of letters, without spaces, such that when some letters are removed, it becomes the word hello. Of course, the order of the characters must not be changed; only some letters can be removed.
- For example: when Binh wants to enter the chat room and types
ahhellllloou, the system will check this string and automatically remove some characters to form the wordhello. Thus, Binh is allowed into the chat room.
But when Binh types hlelo, the system cannot remove any characters to form the word hello. Thus, Binh is not allowed into the chat room.
Requirement: Given ~N~ greetings, determine which greetings are accepted.
Input
- The first line contains a positive integer ~N~ ~(N ≤ 10^3)~.
- The next ~N~ lines, each containing a string of letters that Binh intends to type, with a length from ~1~ to ~10^3~ characters.
Output
- Includes ~N~ lines, each corresponding to a greeting. If the greeting is accepted, output
YES; otherwise, outputNO.
Sample Input
4
ahhellllloouJack
hleloCo
helhcludooBo
HelhcLudooCon
Sample Output
YES
NO
YES
NO
Bình luận