Tag: binary search
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 = , …
Given a list of sorted array containing only lowercase letters, and a target letter, your task is to find the smallest letter in the list that is greater than …