in reply to Array problems.....

This problem is better solved with a hash structure.

The algorithm would be:

Let us know if you have a specific issue with your implementation of this algorithm.

             "I'm fairly sure if they took porn off the Internet, there'd only be one website left, and it'd be called 'Bring Back the Porn!'"
        -- Dr. Cox, Scrubs