I have a block of text (of arbitrary length) with a particular word highlighted in yellow whenever it appears. I want to show only a 400 word chunk of the text but I want to show the chunk with the most highlighted words.
Does anyone know a good algorithm for this?
I have the character position of each highlighted word, so the algorithm needs to find the densest cluster of unevenly spaced integers?