LeetCode 129. Sum Root to Leaf Numbers

2018-01-14
阅读 2 分钟
1.6k
Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number.

LeetCode 200. Number of Islands

2018-01-13
阅读 2 分钟
1.7k
Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may assume all four edges of the grid are all surrounded by water.

LeetCode 300. Longest Increasing Subsequence

2018-01-13
阅读 1 分钟
1.4k
Given an unsorted array of integers, find the length of longest increasing subsequence.

LeetCode 542. 01 Matrix

2018-01-13
阅读 2 分钟
3k
Given a matrix consists of 0 and 1, find the distance of the nearest 0 for each cell.

LeetCode 547. Friend Circles

2018-01-13
阅读 2 分钟
2.7k
There are N students in a class. Some of them are friends, while some are not. Their friendship is transitive in nature. For example, if A is a direct friend of B, and B is a direct friend of C, then A is an indirect friend of C. And we defined a friend circle is a group of students who are direc...

LeetCode 695. Max Area of Island

2018-01-13
阅读 2 分钟
2.4k
Given a non-empty 2D array grid of 0's and 1's, an island is a group of 1's (representing land) connected 4-directionally (horizontal or vertical.) You may assume all four edges of the grid are surrounded by water.

LeetCode 104. Maximum Depth of Binary Tree

2018-01-13
阅读 1 分钟
1.3k
The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.

LeetCode 108. Convert Sorted Array to Binary Search Tree

2018-01-12
阅读 2 分钟
1.6k
Given an array where elements are sorted in ascending order, convert it to a height balanced BST.

LeetCode 94. Binary Tree Inorder Traversal

2018-01-12
阅读 1 分钟
1.1k
Given a binary tree, return the inorder traversal of its nodes' values.

LeetCode 63. Unique Paths II

2018-01-10
阅读 2 分钟
1.3k
Now consider if some obstacles are added to the grids. How many unique paths would there be?

LeetCode 62.Unique Paths

2018-01-10
阅读 1 分钟
2.1k
robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below).The robot can only move either down or right at any point in time. The robot is trying to reach the bottom-right corner of the grid (marked 'Finish' in the diagram below).How many possible unique paths a...

LeetCode 120. Triangle

2018-01-10
阅读 2 分钟
1.7k
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.

leetcode 198. House Robber

2018-01-10
阅读 2 分钟
1.4k
You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent houses have security system connected and it will automatically contact the police if two adjacent hou...

LeetCode 5.Longest Palindromic Substring 求解

2017-09-10
阅读 3 分钟
1.6k
 是一种在数学、管理科学、计算机科学、经济学和生物信息学中使用的,通过把原问题分解为相对简单的子问题的方式求解复杂问题的方法。       动态规划常常适用于有重叠子问题[1]和最优子结构性质的问题,动态规划方法所耗时间往往远少于朴素解法。       动态规划背后的基本思想非常简单。大致上,若要解一个给定问题,...