随笔分类 -  leetcode_dp

动态规划类型题目
摘要:Given an integer n, generate all structurally unique BST's (binary search trees) that store values 1...n. For example,Given n = 3, your program should 阅读全文
posted @ 2017-10-19 10:44 daniel456 阅读(94) 评论(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 @ 2017-10-18 17:32 daniel456 阅读(152) 评论(0) 推荐(0) 编辑
摘要:Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive. Example: Note: 给定一个int数组,返回i和j之间的元素总和,注意时间复杂度 思路 阅读全文
posted @ 2017-10-18 17:23 daniel456 阅读(122) 评论(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 @ 2017-10-18 17:18 daniel456 阅读(150) 评论(0) 推荐(0) 编辑
摘要:You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you cl 阅读全文
posted @ 2017-10-18 17:14 daniel456 阅读(125) 评论(0) 推荐(0) 编辑
摘要:Given a string, your task is to count how many palindromic substrings in this string. The substrings with different start indexes or end indexes are c 阅读全文
posted @ 2017-10-18 15:47 daniel456 阅读(128) 评论(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 @ 2017-10-18 10:18 daniel456 阅读(137) 评论(0) 推荐(0) 编辑
摘要:Given an array of integers and an integer k, you need to find the total number of continuous subarrays whose sum equals to k. Example 1: Input:nums = 阅读全文
posted @ 2017-10-16 19:26 daniel456 阅读(153) 评论(0) 推荐(0) 编辑
摘要: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 fo 阅读全文
posted @ 2017-10-16 16:00 daniel456 阅读(118) 评论(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 @ 2017-10-16 10:52 daniel456 阅读(113) 评论(0) 推荐(0) 编辑
摘要: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 p 阅读全文
posted @ 2017-10-16 10:45 daniel456 阅读(111) 评论(0) 推荐(0) 编辑
摘要:Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the array [-2,1,-3,4,-1,2, 阅读全文
posted @ 2017-10-14 20:12 daniel456 阅读(122) 评论(0) 推荐(0) 编辑

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