LeetCode - Search for a Range
Question Definition
Given an array of integers sorted in ascending order, find the starting and ending position of a given target value.
More …Given an array of integers sorted in ascending order, find the starting and ending position of a given target value.
More …Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.
If such arrangement is not possible, it must rearrange it as the lowest possible order (ie, sorted in ascending order).
The replacement must be in-place, do not allocate extra memory.
More …Given an array of n positive integers and a positive integer s, find the minimal length of a contiguous subarray of which the sum ≥ s. If there isn’t one, return 0 instead.
More …Given a collection of intervals, merge all overlapping intervals.
More …Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times. The algorithm should run in linear time and in O(1) space.
More …