Given a matrix consists of 0 and 1, find the distance of the nearest 0 for each cell. The distance between two adjacent cells is 1. Example 1: Input: ...
分类:
其他好文 时间:
2020-03-16 23:35:41
阅读次数:
72
Given a m * n matrix of distinct numbers, return all lucky numbers in the matrix in any order. A lucky number is an element of the matrix such that it ...
分类:
其他好文 时间:
2020-03-16 09:41:48
阅读次数:
34
问题:求一个数列里三个数相乘的最大值 Input: [1,2,3] Output: 6 Input: [1,2,3,4] Output: 24 Note: 1.The length of the given array will be in range [3,104] and all element ...
分类:
其他好文 时间:
2020-03-15 13:25:00
阅读次数:
53
每日温度。题意是给一个数组,表示每天的气温,请返回一个数组,对应位置的输入是你需要再等待多久温度才会升高超过该日的天数。如果之后都不会升高,请在该位置用 0 来代替。例子, For example, given the list of temperatures T = [73, 74, 75, 71 ...
分类:
其他好文 时间:
2020-03-15 10:02:10
阅读次数:
54
Given an array A of non-negative integers, return the maximum sum of elements in two non-overlapping (contiguous) subarrays, which have lengths L and ...
分类:
移动开发 时间:
2020-03-15 09:54:01
阅读次数:
75
You are given some Tetris field consisting of nn columns. The initial height of the ii-th column of the field is aiai blocks. On top of these columns ...
分类:
其他好文 时间:
2020-03-14 23:53:35
阅读次数:
75
You are given an array aa consisting of nn integers. Your task is to determine if aa has some subsequence of length at least 33 that is a palindrome. ...
分类:
其他好文 时间:
2020-03-14 23:35:49
阅读次数:
96
Given a stack which can keep M numbers at most. Push N numbers in the order of 1, 2, 3, ..., N and pop randomly. You are supposed to tell if a given s ...
分类:
其他好文 时间:
2020-03-14 21:56:52
阅读次数:
69
1 """ 2 A peak element is an element that is greater than its neighbors. 3 Given an input array nums, where nums[i] ≠ nums[i+1], find a peak element a ...
分类:
其他好文 时间:
2020-03-14 21:47:44
阅读次数:
51
1003 Emergency (25分) As an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered cities ...
分类:
其他好文 时间:
2020-03-14 13:14:44
阅读次数:
85