solve extra problem for search in rotated array, adding unit test cases