随笔分类 -  DP

摘要:62. 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 阅读全文
posted @ 2016-12-01 11:18 微微程序媛 阅读(139) 评论(0) 推荐(0) 编辑
摘要: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 inc 阅读全文
posted @ 2016-11-28 07:23 微微程序媛 阅读(113) 评论(0) 推荐(0) 编辑
摘要:Note: This is an extension of House Robber. After robbing those houses on that street, the thief has found himself a new place for his thievery so tha 阅读全文
posted @ 2016-11-28 01:28 微微程序媛 阅读(170) 评论(0) 推荐(0) 编辑
摘要: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 yo 阅读全文
posted @ 2016-11-28 01:01 微微程序媛 阅读(129) 评论(0) 推荐(0) 编辑
摘要:There is a fence with n posts, each post can be painted with one of the k colors. You have to paint all the posts such that no more than two adjacent 阅读全文
posted @ 2016-11-28 00:49 微微程序媛 阅读(370) 评论(0) 推荐(0) 编辑
摘要: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 comple 阅读全文
posted @ 2016-10-31 05:08 微微程序媛 阅读(193) 评论(0) 推荐(0) 编辑
摘要: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 comple 阅读全文
posted @ 2016-10-31 04:09 微微程序媛 阅读(106) 评论(0) 推荐(0) 编辑
摘要: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 comple 阅读全文
posted @ 2016-10-31 04:08 微微程序媛 阅读(147) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2016-10-31 04:08 微微程序媛 阅读(109) 评论(0) 推荐(0) 编辑
摘要:Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path. 阅读全文
posted @ 2016-10-26 00:42 微微程序媛 阅读(151) 评论(0) 推荐(0) 编辑
摘要:You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that you nee 阅读全文
posted @ 2016-10-26 00:20 微微程序媛 阅读(119) 评论(0) 推荐(0) 编辑
摘要:Write a program to find the n-th ugly number. Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 1, 2, 3, 4, 5, 阅读全文
posted @ 2016-10-24 07:36 微微程序媛 阅读(140) 评论(0) 推荐(0) 编辑
摘要:A message containing letters from A-Z is being encoded to numbers using the following mapping: Given an encoded message containing digits, determine t 阅读全文
posted @ 2016-10-24 05:29 微微程序媛 阅读(135) 评论(0) 推荐(0) 编辑
摘要:We are playing the Guess Game. The game is as follows: I pick a number from 1 to n. You have to guess which number I picked. Every time you guess wron 阅读全文
posted @ 2016-10-24 04:48 微微程序媛 阅读(163) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示