-
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.
For example, given n ...
-
A peak element is an element that is greater than its neighbors.
Given an input array where num[i] ≠ num[i+1], find a peak el...
-
Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one dupl...
-
Given an array of n integers where n > 1, nums, return an array output such that output[i] is equal to the product of all ...
-
You are given an n x n 2D matrix representing an image.
Rotate the image by 90 degrees (clockwise).
Note:You have to rotate t...
-
Given a collection of integers that might contain duplicates, nums, return all possible subsets (the power set).
Note: The so...
-
Given a sorted integer array without duplicates, return the summary of its ranges.
Example 1:
123Input: [0,1,2,4,5,7]Output: ...
-
Find all possible combinations of *k* numbers that add up to a number *n*, given that only numbers from 1 to 9 can be used an...
-
Given an array of n positive integers and a positive integer s, find the minimal length of a contiguous subarray of which the...
-
Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.
(i.e., 0 1 2 4 5 6 7 might bec...