October 5th, 2013, 01:32 AM
Urgent Help(please Solve In C)
Given a string S, and a string T, find the length of the smallest substring of S which contains all the characters of T - in any order. If no such substring exists, print -1.
The first line consists of the string S.
The next line consists of a single integer Q, the number of strings "T" that you would query for in S.
Then follow Q lines, each consisting of a single string T.
Q lines, the answers to the Q queries.
1 <= |S| <= 100000
1 <= Q <= 100
1 <= |T| <= 1000
All characters in the input are lowercase 'a'-'z'.
October 5th, 2013, 03:03 AM
Getting someone to do the work for you is not really the point of this homework assignment. Where are you getting stuck? There are two aspects to this: The algorithm, and the C coding. What algorithm do you propose? How far have you got with teh coding?