Originally Posted By: jaytea
i can't really think of a reasonable solution that runs in O(n * log(n)). perhaps something involving an initial sort?

yes, eg sort the array, then for each x in the array use binary search to test for the presence of M-x


Saturn, QuakeNet staff