Tag: binary search
Given a sorted array A of unique numbers, find the K-th missing number starting from the leftmost number of the array. Example 1: Input: A = , K = …
Given a non-negative integer c, your task is to decide whether there’re two integers a and b such that a^2 + b^2 = c. Example 1: Input: 5 Output: …
Given an array of sorted integers and a target, find the index of the target in the array, if not found, return -1. Given a sorted (in ascending order) …
Implement a function countNumbers that accepts a sorted vector of unique numbers (integers), and efficiently with respect to time used, counts the number of vector elements that are less …
Given a sorted arrays with integers and a target to locate, find the first and last position of the element in the sorted array. Example: Input: nums = , …