最新 最热

Leetcode 122 Best Time to Buy and Sell Stock II

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 as ma...

2018-01-12
1

Leetcode 121 Best Time to Buy and Sell Stock

Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transaction (ie, bu...

2018-01-12
1

Leetcode 135 Candy

There are N children standing in a line. Each child is assigned a rating value. You are giving candies to these children subjected to the following requiremen...

2018-01-12
1

Leetcode 174 Dungeon Game

The demons had captured the princess (P) and imprisoned her in the bottom-right corner of a dungeon. The dungeon consists of M x N rooms laid out in a 2D grid....

2018-01-12
1

Leetcode 198 House Robber

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 ro...

2018-01-12
1

Leetcode 221. Maximal Square

Given a 2D binary matrix filled with 0's and 1's, find the largest square containing only 1's and return its area. For example, given the following matrix:1 ...

2018-01-12
1

Leetcode 300. Longest Increasing Subsequence

Given an unsorted array of integers, find the length of longest increasing subsequence. For example, Given [10, 9, 2, 5, 3, 7, 101, 18], The longest increas...

2018-01-12
1

Leetcode 279. Perfect Squares

Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n. For example, given n = 12, return...

2018-01-12
1

51Nod-1232-完美数

该文是关于计算最小公倍数的一种算法实现,通过记录每个数字出现的次数,使用数位dp的方法进行求解,最后返回最小公倍数。

2018-01-09
0

HDU-2490-Parade

该文介绍了如何利用单调队列求解最大高兴值问题,并给出了具体的代码实现。

2018-01-09
1