- 31 Next Permutation
- 46 Permutations
- 47 Permutations II
- 60 Permutation Sequence
The count-and-say sequence is the sequence of integers beginning as follows:
1, 11, 21, 1211, 111221, ...
1is read off as
11is read off as
21is read off as
"one 2, then
Given an integer n, generate the nth sequence.
Note: The sequence of integers will be represented as a string.
Given a string containing just the characters ‘(‘ and ‘)’, find the length of the longest valid (well-formed) parentheses substring.
Explanation: The longest valid parentheses substring is “()”
Explanation: The longest valid parentheses substring is “()()”
You are given a string, S, and a list of words, L, that are all of the same length. Find all starting indices of substring(s) in S that is a concatenation of each word in L exactly once and without any intervening characters.
For example, given:
You should return the indices:
(order does not matter).
Divide two integers without using multiplication, division and mod operator.
If it is overflow, return MAX_INT.
Given n non-negative integers a1, a2, …, an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Find two lines, which together with x-axis forms a container, such that the container contains the most water.
Note: You may not slant the container.