- 博客(19)
- 收藏
- 关注
原创 473. Matchsticks to Square
题目:Remember the story of Little Match Girl? By now, you know exactly what matchsticks the little match girl has, please find out a way you can make one square by using up all those matchsticks. You
2017-06-22 23:38:16
260
原创 Sicily 1176. Two Ends
题目:DescriptionIn the two-player game "Two Ends", an even number of cards is laid out in a row. On each card, face up, is written a positive integer. Players take turns removing a card from either
2017-06-15 10:28:38
288
原创 124. Binary Tree Maximum Path Sum&145.Binary Tree Postorder Traversal
题目:Given a binary tree, find the maximum path sum.For this problem, a path is defined as any sequence of nodes from some starting node to any node in the tree along the parent-child connections. T
2017-06-08 16:40:19
231
原创 336. Palindrome Pairs
题目:Given a list of unique words, find all pairs of distinct indices (i, j) in the given list, so that the concatenation of the two words, i.e. words[i] + words[j] is a palindrome.给定一个序列包含若干个不重
2017-06-01 22:54:15
237
原创 51. N-Queens
题目:The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other.Given an integer n, return all distinct solutions to the n-queens puz
2017-05-26 10:16:21
413
原创 poj 3281 Dining
题目:DescriptionCows are such finicky eaters. Each cow has a preference for certain foods and drinks, and she will consume no others.Farmer John has cooked fabulous meals for his cows, but he fo
2017-05-19 09:39:27
148
原创 207. Course Schedule&576. Out of Boundary Paths
题目:There are a total of n courses you have to take, labeled from 0 to n - 1.Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is expressed
2017-05-11 19:28:08
215
原创 hdoj 1532 Drainage Ditches
题目:Every time it rains on Farmer John's fields, a pond forms over Bessie's favorite clover patch. This means that the clover is covered by water for awhile and takes quite a long time to regrow. Thus,
2017-05-04 18:15:43
337
原创 446. Arithmetic Slices II - Subsequence
题目:A sequence of numbers is called arithmetic if it consists of at least three elements and if the difference between any two consecutive elements is the same.A zero-indexed array A consisting of N
2017-04-27 19:56:59
282
原创 552. Student Attendance Record II
题目:Given a positive integer n, return the number of all possible attendance records with length n, which will be regarded as rewardable. The answer may be very large, return it after mod 109 + 7.
2017-04-20 16:24:50
1127
原创 546. Remove Boxes
题目:Given several boxes with different colors represented by different positive numbers. You may experience several rounds to remove boxes until there is no box left. Each time you can choose some co
2017-04-13 19:56:39
1054
原创 403. Frog Jump
题目:A frog is crossing a river. The river is divided into x units and at each unit there may or may not exist a stone. The frog can jump on a stone, but it must not jump into the water.Given a li
2017-04-06 15:59:45
276
原创 312. Burst Balloons
题目:Given n balloons, indexed from 0 to n-1. Each balloon is painted with a number on it represented by array nums. You are asked to burst all the balloons. If the you burst balloon i you will
2017-03-30 17:27:00
229
原创 330. Patching Array
题目:Given a sorted positive integer array nums and an integer n, add/patch elements to the array such that any number in range [1, n]inclusive can be formed by the sum of some elements in the arr
2017-03-23 19:59:51
276
原创 407. Trapping Rain Water II
题目:Given an m x n matrix of positive integers representing the height of each unit cell in a 2D elevation map, compute the volume of water it is able to trap after raining.给定一个m x n的矩阵,表示一个2维的地图
2017-03-16 16:17:41
313
原创 329. Longest Increasing Path in a Matrix
题目:Given an integer matrix, find the length of the longest increasing path.From each cell, you can either move to four directions: left, right, up or down. You may NOT move diagonally or move outs
2017-03-09 18:12:21
168
原创 4. Median of Two Sorted Arrays
题目:There are two sorted arrays nums1 and nums2 of size m and n respectively.Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).有两个排好序的数组nums1和nums2,
2017-03-02 19:25:42
215
原创 23. Merge k Sorted Lists
题目:Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.合并K个已排序的链表,并将排序结果返回,分析和描述复杂性。 一看到这道题,由于K个链表已经是排好序的,最简单的做法就是每次找出K个链表里最小的那个元素,放入新的链表中。每次选择一
2017-02-23 17:17:16
330
原创 hello world
#include using namespace std;int main(){ cout<<"hello world"<<endl<<endl; return 0;}
2017-02-21 23:27:18
506
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人