[LintCode] Identical Binary Tree

2016-02-02
阅读 1 分钟
2.1k
Check if two binary trees are identical. Identical means the two binary trees have the same structure and every identical position has the same value.

[LintCode] Surrounded Regions

2016-02-02
阅读 2 分钟
2.5k
Given a 2D board containing 'X' and 'O', capture all regions surrounded by 'X'.A region is captured by flipping all 'O''s into 'X''s in that surrounded region.

[LeetCode/LintCode] Binary Tree Paths

2016-02-02
阅读 2 分钟
2.7k
Problem Given a binary tree, return all root-to-leaf paths. Example Given the following binary tree: {代码...} All root-to-leaf paths are: {代码...} Solution {代码...} ###Update 2018-9 {代码...}

[LintCode/LeetCode] Generate Parentheses

2016-02-02
阅读 1 分钟
2.2k
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.

[LeetCode/LintCode] Happy Number

2016-02-02
阅读 1 分钟
2.3k
Write an algorithm to determine if a number is happy.A happy number is a number defined by the following process: Starting with any positive integer, replace the number by the sum of the squares of its digits, and repeat the process until the number equals 1 (where it will stay), or it loops endl...

[LintCode] Longest Increasing Continuous Subsequence

2016-01-31
阅读 3 分钟
2.3k
Give an integer array,find the longest increasing continuous subsequence in this array.An increasing continuous subsequence:Can be from right to left or from left to right.Indices of the integers in the subsequence should be continuous.

[LintCode] Number of Airplanes in the Sky

2016-01-31
阅读 1 分钟
3k
Given an interval list which are flying and landing time of the flight. How many airplanes are on the sky at most?

[LintCode] Continuous Subarray Sum

2016-01-30
阅读 2 分钟
3.2k
Given an integer array, find a continuous subarray where the sum of numbers is the biggest. Your code should return the index of the first number and the index of the last number(If there are duplicate answers, return anyone).

[LeetCode] Graph Valid Tree [Union Find]

2016-01-29
阅读 2 分钟
3.3k
Given n nodes labeled from 0 to n - 1 and a list of undirected edges (each edge is a pair of nodes), write a function to check whether these edges make up a valid tree.