Well hello there suppose you are given an array [1,5,3,6,7,3,67,54] in which every element comes only once except one element which is 3 in this case. The task at hand is to find this element and you are allowed to only use one for loop which is equal to the size of the array.
PS: you might suggest to use hash map but in that case after the traversal of array is over you would need to traverse the hash map to find which key has the value 2 which makes it 2 for loops and is not allowed.
How would you do it ?