Amplitude Hackathon Summer '25 Problem 1 - AI (Easy)

View as PDF

Submit solution

Points: 3 (partial)
Time limit: 1.0s
Memory limit: 1G

Problem type

Amplitude is all in on AI!

Spenser is seeing AI everywhere. In particular, he likes strings if and only if AI is a substring of the string. Formally, AI is a substring of string s if and only if there exists an index i where s_i = A and s_{i+1} = I.

Given a string, determine if Spenser likes it!

Constraints

1 \le T \le 10^4

1 \le |s| \le 50

Input Specification

The first line contains a single integer, T.

The next T lines each contain a single string s of uppercase letters.

Output Specification

Output T lines. On the i^{\text{th}} line, output YES if Spenser likes the i^{\text{th}} string. Otherwise, output NO.

Sample Input 1

4
AMPLITUDEISALLINONAI
AMPLITUDE
AI
IA

Sample Output 1

YES
NO
YES
NO

Comments

There are no comments at the moment.