- 博客(5)
- 收藏
- 关注
原创 leetcode#463 Island Perimeter
Description: You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represents water. Grid cells are connected horizontally/vertically (not diagonally). The grid
2017-04-25 15:14:35 312
原创 leetcode#561 Array Partition I
Description: Given an array of 2n integers, your task is to group these integers into n pairs of integer, say (a1, b1), (a2, b2), …, (an, bn) which makes sum of min(ai, bi) for all i from 1 to n as l
2017-04-25 14:59:38 1174
原创 leetcode#563 Binary Tree Tilt
Description: Given a binary tree, return the tilt of the whole tree. The tilt of a tree node is defined as the absolute difference between the sum of all >left subtree node values and the sum of
2017-04-25 14:39:01 496
原创 leetcode#99 Recover Binary Search Tree
Description: Two elements of a binary search tree (BST) are swapped by mistake. Recover the tree without changing its structure. Solution:这道题如果不考虑空间占用的话只要中序遍历找到乱序的两个数就可以了。但是题目中有说最好使用一个空间为O(1)的算法
2017-04-17 20:40:04 311
原创 leetcode#437 Path Sum III
Description: You are given a binary tree in which each node contains an integer value. Find the number of paths that sum to a given value. The path does not need to start or end at the root
2017-04-16 19:06:52 210
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人