cpp implementation of Search in Rotated Sorted Array II