Search not working properly using Arrays.binarySearch.
But implemented according to assignment