Is there a reason why it's saying it's wrong at first then it's correct? Can I avoid it?
EDIT: I understand why because it's searching through, but can I have it so it automatically jumps to it instead of slowly going through it?
I understand why because it's searching through, but can I have it so it automatically jumps to it instead of slowly going through it?
there are ways to find data with less work. If the array is or can be sorted, you can binary search it, which greatly reduces work needed (20 iterations searches a million items), as one idea (but sorting does cost a lot of work, so you need to look for values several times to make it a net gain).