加载中
542. 01 Matrix

原题链接 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. 看到这个问题最自然的想法是对每个1使用...

2017/07/04 11:37
7
164. Maximum Gap

原题链接 Given an unsorted array, find the maximum difference between the successive elements in its sorted form. Try to solve it in linear time/space. Return 0 if the array con...

2017/06/20 13:01
4
324. Wiggle Sort II

原题链接 Given an unsorted array nums, reorder it such that nums[0] < nums[1] > nums[2] < nums[3].... Follow Up: Can you do it in O(n) time and/or in-place with O(1) extra space...

2017/06/15 10:28
53
147. Insertion Sort List

原题链接 Sort a linked list using insertion sort. 插入排序的思想是每步将一个待排序的对象,按其排序码大小,插入到前面已经排好序的一组对象的适当位置上,直到对象全部插入为止(图来自h...

2017/06/06 19:18
2
71. Simplify Path

原题链接 Given an absolute path for a file (Unix-style), simplify it. For example, path = "/home/", => "/home" path = "/a/./b/../../c/", => "/c" 先根据'/'的位置分割路径字符串,j...

2017/05/31 22:41
0
188. Best Time to Buy and Sell Stock IV

原题链接 Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may complete at most k trans...

2017/05/21 18:13
6
99. Recover Binary Search Tree

原题链接 Two elements of a binary search tree (BST) are swapped by mistake. Recover the tree without changing its structure. Note: A solution using O(n) space is pretty straight...

2017/05/13 22:25
4
149. Max Points on a Line

原题链接 Given n points on a 2D plane, find the maximum number of points that lie on the same straight line. 注意题目中给的点有可能是重复的。要统计哪条直线上的点最多,就一定要计...

2017/05/07 23:11
2
131. Palindrome Partitioning

原题链接 Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s. 题目的意思是给定一个字符串,...

2017/05/04 15:20
18
72. Edit Distance

原题链接 Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.) You have the following 3 op...

2017/04/29 10:38
5
334. Increasing Triplet Subsequence

原题链接 Given an unsorted array return whether an increasing subsequence of length 3 exists or not in the array. 题目的意思是判断数组中是否存在三个数的递增数列,这三个数不要求是...

2017/04/26 12:39
19
57. Insert Interval

原题链接 Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary). You may assume that the intervals were initially sorted accordi...

2017/04/21 11:58
3
403. Frog Jump

原题链接 Given a list of stones' positions (in units) in sorted ascending order, determine if the frog is able to cross the river by landing on the last stone. Initially, the fr...

2017/04/17 20:28
9
133. Clone Graph

原题链接 Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors.Nodes are labeled uniquely. 题目的意思是复制一个图,本质上就是复制节点信息...

2017/04/11 09:48
4
395. Longest Substring with At Least K Repeating Characters

原题链接 Find the length of the longest substring T of a given string (consists of lowercase letters only) such that every character in T appears no less than k times. 这题可以用...

2017/04/04 21:35
125
513. Find Bottom Left Tree Value

原题链接 Given a binary tree, find the leftmost value in the last row of the tree. Note: You may assume the tree (i.e., the given root node) is not NULL. 题目的意思是找到一棵树中...

2017/03/27 12:02
15
456. 132 Pattern

原题链接 Given a sequence of n integers a1, a2, ..., an, a 132 pattern is a subsequence ai, aj, ak such that i < j < k and ai < ak < aj. Design an algorithm that takes a list of...

2017/03/16 15:36
12
2. Add Two Numbers

原题链接 You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. ...

2017/03/13 20:45
0
442. Find All Duplicates in an Array

原题链接 Given an array of integers, 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once. Find all the elements that appear twice in this arra...

2017/03/07 15:36
3
108. Convert Sorted Array to Binary Search Tree

原题连接 Given an array where elements are sorted in ascending order, convert it to a height balanced BST. 将一个已经排好序的数组转化为一棵平衡二分搜索树,我最先想到是用递归,但...

2017/02/27 22:42
2

没有更多内容

加载失败,请刷新页面

返回顶部
顶部