Search 1d array in a 2d array