[-] Question 1
by guyrap - Saturday, 9 May 2009 16:18:59
Hello,

Suppose Y = bacd,
and X = aacdabb (a permutation of the string you gave us.)

In this case, Y's suffix 'acd' appears in places 2,3,4 of string X: is it considered a legitimate solution, or not?
[-] Re: Question 1
by algo092 - Monday, 11 May 2009 09:36:42
No.
Notice that the indixes in a solution are starting from y1 and on...
[-] Re: Question 1
by yaelzar - Thursday, 14 May 2009 09:51:57
I don't think I totally undersand. Is an output like i1 i3 i15 possible?
For example in: Y=bacd, X=abbadca can a possible solution be i1=2, i2 = 4, i4=5?
And if the first letter in Y doesn't exist in X - does it say there's no solution?
Thanks.
Re: Question 1
by algo092 - Thursday, 14 May 2009 10:17:25
In your example the solution cann't be i1=2, i2 = 4, i4=5 since you can't ignore letter c - the third letter in Y.

What you are looking for is the longest prefix of Y contained in X (It doesn't have to appear in a consecutive indixes in X, but in the same order. Also, it doesn't have to be a prefix of X, as long as all the letters in that prefix are in X)
You have to return a list of indixes in X "matching" that prefix.