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
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
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
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