Dynamic Programming_Leetcode_部分动态规划题分析
摘要:5. Longest Palindromic Substring Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. E
阅读全文
单词拆分II
摘要:#单词拆分II#给一字串s和单词的字典dict,在字串中增加空格来构建一个句子,并且所有单词都来自字典。#返回所有有可能的句子。#EXAMPLE:#给一字串lintcode,字典为["de", "ding", "co", "code", "lint"]#结果为["lint code", "lint
阅读全文
Combination Sum IV
摘要:#Given an integer array with all positive numbers and no duplicates, find the number of possible combinations that add up to a positive #integer targe
阅读全文
Best Time to Buy and Sell Stock with Cooldown_LeetCode
摘要:#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 compl
阅读全文
Perfect Squares_LeetCode
摘要:#Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n.#Example 1:#Input: n = 12#
阅读全文
ClimbingStairs & Maximum Subarray_Leetcode
摘要:1. 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
阅读全文
Two Sum_Leetcode
摘要:1. Two Sum Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input wo
阅读全文
单词接龙 II
摘要:单词接龙 II (来自lintecode:https://www.lintcode.com/problem/word-ladder-ii/?_from=ladder&&fromId=1) 给出两个单词(start和end)和一个字典,找出所有从start到end的最短转换序列。 变换规则如下: 1.
阅读全文