Timothy Scott wrote:
With the current code setup the print statement which states which numbers were duplicates is looped within the 1000 array? And when I bring it outside the first set of brackets it says its unable to find the variable i so how do I get that fixed? Any recommendations on how to remove that outside the loop but still have it work. The problem is when it finds a duplicate it needs to say 45 was found as a duplicate 2 times or however many its found
I've simplified it for you here. It may not be the most efficient solution, but it's a quick-fix. In yours, you are populating your array 1000 different times (and checking for duplicates 1000 times), so it will loop for a very, very long time.