Stuck on this implementation — need a hint to understand the next step

1 week ago 6
ARTICLE AD BOX

Thereisanintegerarraynumssortedinascendingorder(withdistinctvalues).Priortobeingpassedtoyourfunction,numsispossiblyrotatedatanunknownpivotindexk(1<=k<nums.length)suchthattheresultingarrayis[nums[k],nums[k+1],...,nums[n-1],nums[0],nums[1],...,nums[k-1]](0-indexed).Forexample,[0,1,2,4,5,6,7]mightberotatedatpivotindex3andbecome[4,5,6,7,0,1,2].Giventhearraynumsafterthepossiblerotationandanintegertarget,returntheindexoftargetifitisinnums,or-1ifitisnotinnums.YoumustwriteanalgorithmwithO(logn)runtimecomplexity.

Read Entire Article