Then the order of the line numbers in the container is the same with the push order (although no influence in this case), and we must handle duplicates by ourselves.
I think set
is better for our purpose, since we don't need duplicated line numbers. The only information we want to know is which line cotains the word, not how many times the word occurs on the same line.