algorithm to compare numbers within a certain distance from each other
<p>So I have an array of numbers that look something like</p>

<pre><code>1,708,234
2,802,532
11,083,432
5,098,123
5,777,111
</code></pre>

<p>I want to find out when two numbers are within a certain distance from each other (say 1,500,000) so I can group them into the same location and have just one UI element represent both for the level of zoom I am looking at.  How would one go about doing this smartly or efficiently.  I'm thinking I would just start with the first entry, loop through all the elements, and if one was close to another, flag those two and put it in a dictionary of some sort.  That would be my brute force method, but I'm thinking there has to be a better way.</p>

<p>I'm coding in obj-c btw if that makes or breaks any design decisions.</p>
