method to sort an array of strings
find an integer in rotated sorted array