41. First Missing Positive 题目链接:https://leetcode.com/problems/first-missing-positive/ Description: Given an unsorted integer array, find the smallest ...
分类:
其他好文 时间:
2019-01-05 21:30:55
阅读次数:
200
描述 Given a sequence, we define the seqence's value equals the difference between the largest element and the smallest element in the sequence. As an e ...
分类:
其他好文 时间:
2018-12-30 17:34:19
阅读次数:
213
Given a two-dimensional array of positive and negative integers, a sub-rectangle is any contiguous sub-array of size 1*1 or greater located within the ...
分类:
其他好文 时间:
2018-12-21 21:23:48
阅读次数:
292
An image is represented by a binary matrix with 0 as a white pixel and 1 as a black pixel. The black pixels are connected, i.e., there is only one bla ...
分类:
其他好文 时间:
2018-12-21 21:17:29
阅读次数:
240
Given an array of 4 digits, return the largest 24 hour time that can be made. The smallest 24 hour time is 00:00, and the largest is 23:59. Starting f ...
分类:
其他好文 时间:
2018-12-02 22:49:46
阅读次数:
185
949. Largest Time for Given Digits (string::compare) Given an array of 4 digits, return the largest 24 hour time that can be made. The smallest 24 hou ...
分类:
其他好文 时间:
2018-12-02 13:38:24
阅读次数:
120
Given a non-negative integer num represented as a string, remove k digits from the number so that the new number is the smallest possible. Note: The l ...
分类:
其他好文 时间:
2018-11-29 15:01:13
阅读次数:
143
DFS 最一开始想到的就是dfs,从题目给的点开始dfs搜索。 时间复杂度为O(mn) Binary Search 这道题给了一个坐标(x,y),其实是有用意的。如果只是单纯的搜索,我们完全可以搜索整个图。 这道题其实可以用二分来做。由于给定的点是黑的,我们可以从水平和竖直两个方向,分别找到由黑变白 ...
分类:
其他好文 时间:
2018-11-12 11:39:22
阅读次数:
234
A sorted list A contains 1, plus some number of primes. Then, for every p < q in the list, we consider the fraction p/q. What is the K-th smallest fra ...
分类:
其他好文 时间:
2018-11-09 20:52:52
阅读次数:
296
Given an integer array, return the k-th smallest distance among all the pairs. The distance of a pair (A, B) is defined as the absolute difference bet ...
分类:
其他好文 时间:
2018-11-08 22:09:02
阅读次数:
142