search two non-repeating elements in array