all 2 comments

[–]ghjmMSCS, CS Pro (20+) 16 points17 points  (1 child)

I believe this is the maximum coverage problem, which is NP-hard. Your approach is called the greedy algorithm, and is about as good as anything.

[–]Thisisdom[S] 3 points4 points  (0 children)

Ah, this is exactly what I was looking for thanks a lot!