You could use the same principle as my "CalculateMedian" routine.
http://masm32.com/board/index.php?topic=8671.msg94735#msg94735Highest phone number = 9999999 = 1250000 bytes to populate = 1.1921 MB memory usage.
Read in all phone numbers and set the corresponding bit in the memory table.
for example: 1234567
1234567 shr 3 = 154320 -> jump to byte offset 154320 in memory.
1234567 and 7 = 7 -> set bit 7
Do this for all phone numbers and set the corresponding bits.
When done start reading the first bit, if set the phone number = 0000000
Read the next bit, if set the phone number is 0000001
Read the next bit, if set the phone number is 0000002 etc. till you reach bit number 9999999.
If a bit is not set it is not a phone number.
This way you have automatically sorted the telephone numbers and you will get rid of duplicate numbers.
Very fast routine and it uses only 1.1921 MB memory