From: Daniel Amelang Date: 2005-08-02T14:11:04+09:00 Subject: Re: algorithm help Instead of looking for ranges, why not look for gaps in the sequence as you read in the input. Keep track of where each gap occurs (beginning and end), like an inverse range. If you do this as you populate your array, you won't have to go back and traverse the array afterwards (hence the O(n)). Hmmm...you would have thought about that by now if it were _that_ easy :) Sorry, Ara, I guess I don't fully understand your problem. Dan