Implement rotated array binary search with duplicates | Microsoft Interview Question