class Solution: def largeGroupPositions(self, S: str) -> List[List[int]]: ans = [] size = len(S) if size 2: ans.append([i, j - 1]) i = j ... ...
分类:
其他好文 时间:
2019-04-13 11:03:22
阅读次数:
132
Description Farmer John has built a new long barn, with N (2 <= N <= 100,000) stalls. The stalls are located along a straight line at positions x1,... ...
分类:
其他好文 时间:
2019-03-26 09:23:14
阅读次数:
195
Your car starts at position 0 and speed +1 on an infinite number line. (Your car can go into negative positions.) Your car drives automatically accord ...
分类:
其他好文 时间:
2019-02-11 00:59:54
阅读次数:
259
"75. Find Peak Element" Description There is an integer array which has the following features: The numbers in adjacent positions are different. A[0] ...
分类:
其他好文 时间:
2019-02-09 10:45:29
阅读次数:
177
In a string S of lowercase letters, these letters form consecutive groups of the same character. For example, a string like S = "abbxxxxzyy" has the g ...
分类:
其他好文 时间:
2019-01-28 23:07:06
阅读次数:
176
Permutation p is an ordered set of integers p1, p2, ..., pn, consisting of n distinct positive integers, each of them doesn't exceed n. We'll denote t ...
分类:
其他好文 时间:
2018-12-20 18:46:23
阅读次数:
178
In a string S of lowercase letters, these letters form consecutive groups of the same character. For example, a string like S = "abbxxxxzyy" has the g ...
分类:
编程语言 时间:
2018-12-08 13:37:09
阅读次数:
131
Given a string S of '(' and ')' parentheses, we add the minimum number of parentheses ( '(' or ')', and in any positions ) so that the resulting paren ...
分类:
其他好文 时间:
2018-12-05 13:22:20
阅读次数:
274
On an infinite number line (x-axis), we drop given squares in the order they are given. The i-th square dropped (positions[i] = (left, side_length)) i ...
分类:
其他好文 时间:
2018-12-01 20:13:02
阅读次数:
219
Let's design a new chess game. There are N positions to hold M chesses in this game. Multiple chesses can be located in the same position. The positio ...
分类:
其他好文 时间:
2018-11-28 22:28:38
阅读次数:
185