Given a sorted (int array) and a target integer in the array. Rotate the array (target integer) times and return the index of that (target integer) in the array. if that target integer does not exist in the array, return -1.
nums: [0,1,2,3,4,5,6,7,8]
target integer: 6
rotated nums: [6,7,8,0,1,2,3,4,5]
should return 0
Hints: Try to find pivot element with binary search. In binary search, we calculate the pivot index like this: (lower bound + upper bound) / 2. Bu this can be changed based on need.