A problem finding optimal number of sentences and possible solutions

We were asked to develop a piece of software which will select an optimal combination of sentences from e-books which will give the closest result to a set of targets for each character

Click here to read the article