Driver code
if __name__ == ' _ _ main _ _ ' : NEW_LINE INDENT arr = [ " aba " , " baba " , " aba " , " xzxb " ] NEW_LINE n = len ( arr ) NEW_LINE q = [ " aba " , " xzxb " , " ab " ] NEW_LINE m = len ( q ) NEW_LINE answerQueries ( arr , n , q , m ) NEW_LINE DEDENT