Redirecting to
NADOS

Suffix Tree - Dictionary Queries

You are given a string S, and Q queries.
Each query consist of a string T.
You have to determine if T is a substring of S.
Input Format
Input consist of A string S and an integer Q followed by Q strings 
Output Format
If T is a substring of S, print "y", else print "n"
Question Video
Constraints
|S| <= 10^5
Q <= 1000
|T| <= 1000
Sample Input
2
abcdefghABCDEFGH
2
abc
abAB
xyz
1
xyz
Sample Output
y
n
y


  • Asked in Companies
  • Related Topics






Video Solution

Code Solution

Run
 
Run
Id Name