Write a method to perform a binary search on a rotated sorted array.
MediumProblem Statement
Write a method to perform a binary search on a rotated sorted array.
Sample Input
Array: [4, 5, 6, 7, 0, 1, 2], Target: 6
Sample Output
2
Limits
Time: 2s · Memory: 256 MB