Re: [algogeeks] Re: Strings search problem

2010-12-31 Thread Akash Agrawal
http://tech-queries.blogspot.com/2010/12/finding-minimum-window-in-array-which.html just use words in place of chars... Regards, Akash Agrawal http://tech-queries.blogspot.com/ On Fri, Dec 31, 2010 at 11:00 AM, Davin wrote: > Find the area with less distance between words. Distance is measur

[algogeeks] Re: Strings search problem

2010-12-30 Thread Davin
Find the area with less distance between words. Distance is measured words count in between two words. On Dec 30, 4:08 pm, 周翔 wrote: > "Distance is measured on number of words." what is your meaning ?  can you > explain it? > > 2010/12/29 Davin > > > > > > > > > Given set of words, find an area

Re: [algogeeks] Re: Strings search problem

2010-12-29 Thread aniket chatterjee
Take three pointers. p for bat q for cat r for mat Then first find the first ocurrences of bat, cat, mat in the text. Find min(abs(p-q),abs(q-r),abs(r-p)); Now among p,q,r which is minimum find next ocurrence of that particular string in the text.Update the corresponding pointer value. Again find

[algogeeks] Re: Strings search problem

2010-12-29 Thread Davin
my bad.. input : words [“bat”, “cat”, “mat”] text : “bat stop the mat blah blah cat by mat bat tra la la” Output area is “cat by mat bat” Please let me know if problem still not clear. On Dec 29, 7:40 pm, mohit ranjan wrote: > In area “cat by mat bat” where is "jat" and "pat" ? > > Can y