动态规划
zyp7355
这个作者很懒,什么都没留下…
展开
-
leetcode #75 Sort Colors
Given an array with n objects colored red, white or blue, sort them in-place so that objects of the same color are adjacent, with the colors in the order red, white and blue. Here, we will use the int...原创 2020-02-19 07:04:30 · 116 阅读 · 1 评论 -
leetcode#70 climbing stair
ou 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 climb to the top? Note: Given n will be a positive in...原创 2020-04-14 05:49:21 · 102 阅读 · 0 评论 -
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 many transactions as you like (i.e., buy one...原创 2020-03-04 04:30:15 · 78 阅读 · 0 评论 -
leetnode#96. Unique Binary Search Trees
Given n, how many structurally unique BST’s (binary search trees) that store values 1 … n? Example: Input: 3 Output: 5 Explanation: Given n = 3, there are a total of 5 unique BST’s: 1 3 3 ...原创 2020-02-25 05:48:57 · 72 阅读 · 0 评论 -
leetcode# 74 Search a 2D Matrix
Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: Integers in each row are sorted from left to right. The first integer of each row i...原创 2020-02-19 03:42:00 · 73 阅读 · 0 评论 -
leetcode 64. Minimum Path Sum
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. Note: You can only move either down or right at an...原创 2020-02-17 03:31:38 · 65 阅读 · 0 评论 -
leetcode#62 unique paths
Unique Paths Medium 2384 174 Add to List Share 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 po...原创 2020-02-16 06:27:41 · 84 阅读 · 0 评论