Given an ascending array of distinct integers, return the index of target or -1 when it is absent.
Input / output
nums: integer[], target: integerExamples
nums = [-1,0,3,5,9,12], target = 9 returns 4.target = 2 returns -1.Constraints
0 <= nums.length <= 100,000Follow-up Explain the loop invariant and how you avoid midpoint overflow in fixed-width integer languages.