Grace is inspecting a reel of punch tape represented by a string S consisting of English letters.
A tape is considered "buggy" if it contains the continuous substring "moth".
The letters must appear in that exact order and contiguously, regardless of whether they are uppercase or lowercase.
Given the string S, determine if the tape is buggy.
Input Format The first line contains an integer T, the number of test cases. Each test case contains a single string S. Output Format
For each test case:
Print YES if the string contains at least one occurrence of "moth" (case-insensitive). Print NO otherwise.
The checker is case-insensitive.
Input
3 Moth hello moTHology
Output
YES NO YES
1 ≤ T ≤ 100 1 ≤ |S| ≤ 10^5
Expert in Data Structures & Algorithms. Building tools to help developers crack FAANG interviews.
ICPC Algoqueen • Pending
ICPC Algoqueen • Pending
ICPC Algoqueen • Pending
Flipkart Grid 8.0 • Pending
Flipkart Grid 8.0 • Pending