This is search the value in array using optimized way.