
DP
文章平均质量分 72
雨中鹰
这个作者很懒,什么都没留下…
展开
-
[leetcode]Unique Paths
Unique Paths A 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原创 2015-05-10 19:21:59 · 356 阅读 · 0 评论 -
[leetcode]Maximum Product Subarray
Maximum Product Subarray Find the contiguous subarray within an array (containing at least one number) which has the largest product.For example, given the array [2,3,-2,4],the contiguou原创 2015-04-30 21:55:56 · 351 阅读 · 0 评论 -
[leetcode]House Robber
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 robbing each of them原创 2015-04-17 15:57:16 · 324 阅读 · 0 评论 -
[leetcode]Gas Station
Gas Station There are N gas stations along a circular route, where the amount of gas at station i is gas[i].You have a car with an unlimited gas tank and it costs cost[i] of gas to trave原创 2014-07-23 21:00:59 · 518 阅读 · 0 评论 -
求两个字符串的最长公共子串
求两个字符串的最长公共子串思路:原创 2014-07-21 18:21:57 · 1141 阅读 · 0 评论 -
[leetcode]Palindrome Partitioning II
Palindrome Partitioning II Given a string s, partition s such that every substring of the partition is a palindrome.Return the minimum cuts needed for a palindrome partitioning of s.For原创 2014-05-23 20:24:33 · 504 阅读 · 0 评论 -
[leetcode]Interleaving String
Interleaving String Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.For example,Given:s1 = "aabcc",s2 = "dbbca",When s3 = "aadbbcbcac", return true.原创 2014-05-22 09:06:12 · 585 阅读 · 0 评论 -
[leetcode]Word Break II
Word Break II Total Accepted: 8514 Total Submissions: 54862My SubmissionsGiven a string s and a dictionary of words dict, add spaces in s to construct a sentence where each word is a val原创 2014-05-16 21:36:25 · 617 阅读 · 0 评论 -
[leetcode]Word Break
Word Break Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words.For example, givens = "leetcod原创 2014-05-16 21:27:57 · 429 阅读 · 0 评论 -
微软面试题--翻转数组中的一段,使0为1,1为0,求此数组中1的个数最多
给定数组如:[0, 1, 0, 1, 1, 0, 0, 0]原创 2014-05-14 12:45:55 · 3282 阅读 · 0 评论 -
求二维数组最大子数组和(或矩阵的最大子矩阵和)
int findMaxSumOfMatrix(vector > &vvi){ int m = vvi.size(); if(0 == m) return 0; int n = vvi[0].size(); int maxValue = vvi[0][0]; for(int i = 0; i < m; i++){ //从第0行开始 vector vi(n, 0); for(原创 2014-05-14 11:26:31 · 1764 阅读 · 0 评论 -
[leetcode]Triangle
Triangle Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the following triangle[ [2]原创 2014-04-21 09:07:17 · 562 阅读 · 0 评论 -
[leetcode]Binary Tree Maximum Path Sum
Binary Tree Maximum Path Sum Given a binary tree, find the maximum path sum.The path may start and end at any node in the tree.For example:Given the below binary tree, 1原创 2014-04-20 19:38:35 · 690 阅读 · 0 评论 -
[leetcode]Jump Game I II
Jump Game Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that positi原创 2014-04-18 21:36:23 · 519 阅读 · 0 评论