
动态规划
Charles-Liu
这个作者很懒,什么都没留下…
展开
-
Largest Plus Sign
[leetcode]Largest Plus Sign链接:https://leetcode.com/problems/largest-plus-sign/description/QuestionIn a 2D grid from (0, 0) to (N-1, N-1), every cell contains a 1, except those cells in the giv...原创 2018-08-03 22:26:31 · 185 阅读 · 0 评论 -
Minimum Swaps To Make Sequences Increasing
[leetcode]Minimum Swaps To Make Sequences Increasing链接:https://leetcode.com/problems/maximum-length-of-repeated-subarray/description/QuestionWe have two integer sequences A and B of the same n...原创 2018-08-02 22:24:37 · 166 阅读 · 0 评论 -
Best Time to Buy and Sell Stock with Cooldown
[leetcode]Best Time to Buy and Sell Stock with Cooldown链接:https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-cooldown/description/QuestionSay you have an array for which the i*...原创 2018-08-02 22:24:56 · 118 阅读 · 0 评论 -
Cheapest Flights Within K Stops
[leetcode]Cheapest Flights Within K Stops链接:https://leetcode.com/problems/cheapest-flights-within-k-stops/description/QuestionThere are n cities connected by m flights. Each fight starts from ...原创 2018-08-07 22:30:28 · 329 阅读 · 0 评论 -
Decode Ways
[leetcode]Decode Ways链接:https://leetcode.com/problems/decode-ways/description/QuestionA message containing letters from A-Z is being encoded to numbers using the following mapping:‘A’ -> ...原创 2018-08-07 22:30:58 · 187 阅读 · 0 评论 -
Maximal Square
[leetcode]Maximal Square链接:https://leetcode.com/problems/maximal-square/description/QuestionGiven a 2D binary matrix filled with 0’s and 1’s, find the largest square containing only 1’s and re...原创 2018-08-07 22:31:47 · 115 阅读 · 0 评论 -
Maximum Product Subarray
[leetcode]Maximum Product Subarray链接:https://leetcode.com/problems/maximum-product-subarray/description/QuestionGiven an integer array nums, find the contiguous subarray within an array (...原创 2018-08-07 22:32:10 · 139 阅读 · 0 评论 -
Number of Longest Increasing Subsequence
[leetcode]Number of Longest Increasing Subsequence链接:https://leetcode.com/problems/additive-number/description/QuestionGiven an unsorted array of integers, find the number of longest increasin...原创 2018-08-07 22:32:30 · 134 阅读 · 0 评论 -
Range Sum Query 2D - Immutable
[leetcode]Range Sum Query 2D - Immutable链接:https://leetcode.com/problems/range-sum-query-2d-immutable/QuestionGiven a 2D matrix matrix, find the sum of the elements inside the rectangle define...原创 2018-08-07 22:33:23 · 188 阅读 · 0 评论 -
Largest Divisible Subset
[leetcode]Largest Divisible Subset链接:https://leetcode.com/problems/largest-divisible-subset/description/QuestionGiven a set of distinct positive integers, find the largest subset such that eve...原创 2018-08-12 21:53:12 · 129 阅读 · 0 评论 -
Minimum Path Sum
[leetcode]Minimum Path Sum链接:https://leetcode.com/problems/minimum-path-sum/description/QuestionGiven a m x n grid filled with non-negative numbers, find a path from top left to bottom right w...原创 2018-08-12 21:54:12 · 120 阅读 · 0 评论 -
Ones and Zeroes
[leetcode]Ones and Zeroes链接:https://leetcode.com/problems/ones-and-zeroes/description/QuestionIn the computer world, use restricted resource you have to generate maximum benefit is what we alw...原创 2018-08-12 21:55:42 · 184 阅读 · 0 评论 -
Out of Boundary Paths
[leetcode]Out of Boundary Paths链接:https://leetcode.com/problems/out-of-boundary-paths/description/QuestionThere is an m by n grid with a ball. Given the start coordinate&nb...原创 2018-08-12 21:55:58 · 315 阅读 · 0 评论 -
Partition Equal Subset Sum.cpp
[leetcode]416-Partition Equal Subset Sum链接:https://leetcode.com/problems/partition-equal-subset-sum/description/QuestionGiven a non-empty array containing only positive integers, find if the a...原创 2018-08-12 21:56:13 · 149 阅读 · 0 评论 -
Perfect Squares
[leetcode]Perfect Squares链接:https://leetcode.com/problems/ugly-number/description/QuestionGiven a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16,...原创 2018-08-12 21:57:01 · 176 阅读 · 0 评论 -
Continuous Subarray Sum
[leetcode]Continuous Subarray Sum链接:https://leetcode.com/problems/continuous-subarray-sum/description/QuestionGiven a list of non-negative numbers and a target integer k, w...原创 2018-08-08 22:31:42 · 137 阅读 · 0 评论 -
New 21 Game
[leetcode]New 21 Game链接:https://leetcode.com/problems/new-21-game/description/QuestionAlice plays the following game, loosely based on the card game “21”.Alice starts with 0 points, and draw...原创 2018-08-08 22:33:12 · 272 阅读 · 0 评论 -
week16-leetcode #198-House Robber
week16-leetcode #198-House Robber链接:https://leetcode.com/problems/house-robber/description/QuestionYou are a professional robber planning to rob houses along a street. Each house has a certain amount o原创 2017-12-27 21:58:52 · 203 阅读 · 0 评论 -
Maximum Length of Repeated Subarray
[leetcode]Maximum Length of Repeated Subarray链接:https://leetcode.com/problems/maximum-length-of-repeated-subarray/description/QuestionGiven two integer arrays A and B, return th...原创 2018-08-02 22:24:15 · 141 阅读 · 0 评论 -
Largest Sum of Averages
[leetcode]Largest Sum of Averages链接:https://leetcode.com/problems/largest-sum-of-averages/description/QuestionWe partition a row of numbers A into at most K adjacent (non-empty) groups, then o...原创 2018-08-02 22:23:37 · 170 阅读 · 0 评论 -
Knight Probability in Chessboard
[leetcode]Knight Probability in Chessboard链接:https://leetcode.com/problems/knight-probability-in-chessboard/description/QuestionOn an NxN chessboard, a knight starts at the r-th row and c-th ...原创 2018-08-03 22:27:24 · 207 阅读 · 0 评论 -
LongestUnivaluePath
[leetcode]Out of Boundary Paths链接:https://leetcode.com/problems/out-of-boundary-paths/description/QuestionThere is an m by n grid with a ball. Given the start coordinate&nb...原创 2018-08-03 22:27:44 · 113 阅读 · 0 评论 -
Target Sum
[leetcode]Target Sum链接:https://leetcode.com/problems/target-sum/description/QuestionYou are given a list of non-negative integers, a1, a2, …, an, and a target, S. Now you have 2 symbols + and ...原创 2018-08-03 22:28:10 · 207 阅读 · 0 评论 -
2 keys keyboard
[leetcode]2 keys keyboard链接:https://leetcode.com/problems/2-keys-keyboard/QuestionInitially on a notepad only one character ‘A’ is present. You can perform two operations on this notepad for e...原创 2018-08-01 22:27:34 · 289 阅读 · 0 评论 -
Best Time to Buy and Sell Stock with Transaction Fee
[leetcode]Best Time to Buy and Sell Stock with Transaction Fee链接:https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-transaction-fee/description/QuestionYour are given an array ...原创 2018-08-01 22:29:02 · 192 阅读 · 0 评论 -
Can I Win
[leetcode]Can I Win链接:https://leetcode.com/problems/can-i-win/description/QuestionIn the “100 game,” two players take turns adding, to a running total, any integer from 1..10. The player who f...原创 2018-08-01 22:30:01 · 200 阅读 · 0 评论 -
Count Numbers with Unique Digits
[leetcode]Count Numbers with Unique Digits链接:https://leetcode.com/problems/count-numbers-with-unique-digits/description/QuestionGiven a non-negative integer n, count all numbers with...原创 2018-08-01 22:30:45 · 113 阅读 · 0 评论 -
Integer Break
[leetcode]Integer Break链接:https://leetcode.com/problems/integer-break/description/QuestionGiven a positive integer n, break it into the sum of at least two positive integers and maximize the p...原创 2018-08-01 22:31:16 · 99 阅读 · 0 评论 -
Predict the Winner
[leetcode]Predict the Winner链接:https://leetcode.com/problems/predict-the-winner/description/QuestionGiven an array of scores that are non-negative integers. Player 1 picks one of the numbers f...原创 2018-08-01 22:31:47 · 219 阅读 · 0 评论 -
Stone Game
[leetcode]Stone Game链接:https://leetcode.com/problems/stone-game/description/QuestionAlex and Lee play a game with piles of stones. There are an even number of piles arranged in a row, and eac...原创 2018-08-01 22:32:42 · 745 阅读 · 0 评论 -
Soup Servings
[leetcode]Soup Servings链接:https://leetcode.com/problems/soup-servings/description/QuestionThere are two types of soup: type A and type B. Initially we have N ml of each type of soup. There are...原创 2018-08-14 22:10:25 · 206 阅读 · 0 评论 -
Triangle
[leetcode]Triangle链接:https://leetcode.com/problems/triangle/description/QuestionGiven a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on th...原创 2018-08-14 22:11:54 · 408 阅读 · 0 评论 -
Domino and Tromino Tiling
[leetcode]Domino and Tromino Tiling链接:https://leetcode.com/problems/domino-and-tromino-tiling/description/QuestionWe have two types of tiles: a 2x1 domino shape, and an “L” tromino shape. Thes...原创 2018-08-11 22:19:10 · 223 阅读 · 0 评论 -
Guess Number Higher or Lower II
[leetcode]Guess Number Higher or Lower II链接:https://leetcode.com/problems/guess-number-higher-or-lower-ii/description/QuestionWe are playing the Guess Game. The game is as follows:I pick a n...原创 2018-08-11 22:19:57 · 211 阅读 · 0 评论 -
Length of Longest Fibonacci Subsequence
[leetcode]Length of Longest Fibonacci Subsequence链接:https://leetcode.com/problems/length-of-longest-fibonacci-subsequence/description/QuestionA sequence X_1, X_2, ..., X_n is fibonacci-like if...原创 2018-08-02 22:22:32 · 423 阅读 · 0 评论 -
Unique Substrings in Wraparound String
[leetcode]Unique Substrings in Wraparound String链接:https://leetcode.com/problems/unique-substrings-in-wraparound-string/description/QuestionConsider the string s to be the infinite wraparound ...原创 2018-08-21 19:07:31 · 181 阅读 · 0 评论