Codeforces Checking (Codeforces 1791A)
Tags: Implement, strings

Given a lowercase Latin character (letter), check if it appears in the string $$$\texttt{codeforces}$$$.

Input: The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 26$$$) — the number of test cases.The only line of each test case contains a character $$$c$$$ — a single lowercase Latin character (letter).

Output: For each test case, output "YES" (without quotes) if $$$c$$$ satisfies the condition, and "NO" (without quotes) otherwise.You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).


Sample Inputs:
10
a
b
c
d
e
f
g
h
i
j

Sample Outputs:
NO
NO
YES
YES
YES
YES
NO
NO
NO
NO

Solution (Python):
testCases = int(input(''))
for i in range(0, testCases):
    if input('') in 'codeforces':
        print('YES')
    else:
        print('NO')

Solution (Python):
def check_character(char):
    codeforces_str = 'codeforces'
    return 'YES' if char in codeforces_str else 'NO'
t = int(input())
for _ in range(t):
    char = input().strip()
    result = check_character(char)
    print(result)

Solution (Python):
n = int(input())
l = 'codeforces'
while n != 0:
    n -= 1
    a = input()
    for i in a:
        if i in l:
            print('YES')
        else:
            print('NO')