@amit: does the order of characters in Ssmall have to be the same in Sbig? On 6/27/10, amit <[email protected]> wrote: > @ above can u plzz explain how to do it using LCS... > > I think u r finding the LCS and then backtracking to keep into account > the first and the last characters of the LCS in the Longer > string....Correct me if I am wrong... > > On Jun 27, 9:57 am, Anand <[email protected]> wrote: >> http://codepad.org/NDAeIpxR >> <http://codepad.org/NDAeIpxR>Here is code for it >> >> On Sat, Jun 26, 2010 at 9:54 PM, Anand <[email protected]> wrote: >> > you can use Longest common subsequence algorithm to solve it. >> >> > On Sat, Jun 26, 2010 at 4:04 PM, amit <[email protected]> wrote: >> >> >> You r given a large string of characters lets call it Sbig. Then there >> >> is a small set of characters lets call it Ssmall. You have to find >> >> smallest substring of Sbig which contains all characters in Ssmall. >> >> >> For example you are given Sbig = "hello what are you doing" >> >> Ssmall= "eo" >> >> >> answer is "ello" >> >> 24 >> >> >> -- >> >> You received this message because you are subscribed to the Google >> >> Groups >> >> "Algorithm Geeks" group. >> >> To post to this group, send email to [email protected]. >> >> To unsubscribe from this group, send email to >> >> [email protected]<algogeeks%[email protected]> >> >> . >> >> For more options, visit this group at >> >>http://groups.google.com/group/algogeeks?hl=en. > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > >
-- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
