solution could be to find the charcter position from both sides for each char of s2 then from the 2*n array, find the smallest index from left and largest from right, within these two indexes all chars would be there
one case where one of the chars can be missing can be found if a row in this 2-d array remains unmodified Best Regards Ashish Goel "Think positive and find fuel in failure" +919985813081 +919966006652 On Sat, Jul 31, 2010 at 10:22 PM, Nikhil Jindal <fundoon...@yahoo.co.in>wrote: > At the moment, I can only think of an O(n^3) algo. > Maybe if you can find a hash function which computes the hash value > depending on the unique characters the string contains, you can reduce it to > O(n^2). > > > On Sat, Jul 31, 2010 at 7:09 PM, srikanth sg <srikanthini...@gmail.com>wrote: > >> given two string , find the minimum width in string 1 containing the >> all characters of string 2 , they may present in different order >> string 1-HELLO >> string 2- LE >> answer-2 >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to algoge...@googlegroups.com. >> To unsubscribe from this group, send email to >> algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups.com> >> . >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> >> > Please access the attached hyperlink for an important electronic > communications disclaimer: > http://dce.edu/web/Sections/Standalone/Email_Disclaimer.php > > > > > -- > > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > > To post to this group, send email to algoge...@googlegroups.com. > > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com > <algogeeks%2bunsubscr...@googlegroups.com>. > > > 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 algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.