Write an iterator that iterates through a run-length encoded sequence. The iterator is initialized by RLEIterator(int[] A), where A is a run-length en ...
分类:
其他好文 时间:
2019-01-13 14:21:03
阅读次数:
130
Starting with a positive integer N, we reorder the digits in any order (including the original order) such that the leading digit is not zero. Return ...
分类:
其他好文 时间:
2019-01-13 14:19:23
阅读次数:
178
Given an array A of integers, return the number of (contiguous, non-empty) subarrays that have a sum divisible by K. Example 1: Input: A = [4,5,0,-2,- ...
分类:
其他好文 时间:
2019-01-13 13:45:16
阅读次数:
365
You are given an integer array A. From some starting index, you can make a series of jumps. The (1st, 3rd, 5th, ...) jumps in the series are called od ...
分类:
其他好文 时间:
2019-01-13 13:43:04
阅读次数:
268
We have a list of points on the plane. Find the K closest points to the origin (0, 0). (Here, the distance between two points on a plane is the Euclid ...
分类:
其他好文 时间:
2019-01-13 13:42:33
阅读次数:
247
Given a (singly) linked list with head node root, write a function to split the linked list into k consecutive linked list "parts". The length of each ...
分类:
其他好文 时间:
2019-01-12 21:00:12
阅读次数:
121
Two images A and B are given, represented as binary, square matrices of the same size. (A binary matrix has only 0s and 1s as values.) We translate on ...
分类:
其他好文 时间:
2019-01-11 18:03:12
阅读次数:
191
Let's play the minesweeper game (Wikipedia, online game)! You are given a 2D char matrix representing the game board. 'M' represents an unrevealed min ...
分类:
其他好文 时间:
2019-01-11 15:58:03
阅读次数:
147
https://leetcode.com/problems/first-missing-positive/ O(1)空间复杂度,找到最小的没有出现在nums中的正整数。 其实算不上严格的swap,因为不用交换,当前的位置上如果不是正确放置的(不是正确放置:nums[i]!=i)那么,就把这个数字放到 ...
分类:
其他好文 时间:
2019-01-10 15:31:55
阅读次数:
170
I have been quite annoyed by a Windows bug that causes a huge number of open-source command-line tools to choke on multi-byte characters at the Window ...
分类:
其他好文 时间:
2019-01-09 22:47:39
阅读次数:
389