Alphabets are taken out of the bucket as the words are formed. (Alphabets used in the 1st word
are taken out of the bucket after it is formed. Next word is formed based on the only remaining
alphabets in the bucket and so on.)
Input:
Line 1 - English alphabets in bucket with comma separated
Line 2 - No of words(n) that Anne going to give to John
next n lines - words that Anne gave to John
Output:
n lines of "YES" or "NO"
Example 1:
Input:
H, F, B, A, C, L, K, G, V, C, B, I, U, K, F
1
BLACKBUCK
Output:
YES
Explanation:
The bucket of alphabets has all the letters in the given word "BLACKBUCK" so the output
is "YES"
Answers
Answered by
0
Answer:
RU pom gana is the question
Similar questions