Https://ide.codingblocks.com/s/121951

failing one test case

your logic is not correct as you are simply applying binary search…binary search can be only applied if the array is sorted(here a sorted array is rotated)…try modifying your binary search algo to find the index
runtime complexity of this prog should be logn