Binary Search
Given an array of integers nums which is sorted in ascending order, and an integer target, write a function to search target in nums...
Given an array of integers nums which is sorted in ascending order, and an integer target, write a function to search target in nums...
Given an integer array nums and two integers lower and upper, return the number of range sums that lie in [lower, upper] inclusive.
Given a sorted integer array arr, two integers k and x, return the k closest integers to x in the array.
Given the sorted rotated array nums of unique elements, return the minimum element of this array.
A peak element is an element that is strictly greater than its neighbors.
Return the smallest character in letters that is lexicographically greater than target. If such a character does not exist, return the first character in letters.
Implement a function to find the first bad version. You should minimize the number of calls to the API.
Given two sorted arrays nums1 and nums2 of size m and n respectively, return the median of the two sorted arrays.
An array arr a mountain if the following properties hold...
You need to implement the function pickIndex(), which randomly picks an index in the range [0, w.length - 1] (inclusive) and returns it.
Write an efficient algorithm that searches for a value target in an m x n integer matrix matrix.
Write an efficient algorithm that searches for a value target in an m x n integer matrix matrix.
Given the array nums after the possible rotation and an integer target, return the index of target if it is in nums, or -1 if it is not in nums.
Given the array nums after the rotation and an integer target, return true if target is in nums, or false if it is not in nums.
Design a time-based key-value data structure that can store multiple values for the same key at different time stamps and retrieve the key's value at a certain timestamp.