scramble-string——两个字符串经过树化并旋转后是否一致、递归、动态规划

Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible represen
183次阅读

[LeetCode] Decode Ways 解码方法个数、动态规划

A message containing letters from A-Z is being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an
79次阅读

Distinct Subsequences(不同子序列的个数)——b字符串在a字符串中出现的次数、动态规划

Given a string S and a string T, count the number of distinct subsequences ofT inS.A subsequence of a string is a new string which
109次阅读

candy——动态规划

There are N children standing in a line. Each child is assigned a rating value.You are giving candies to these children subjected to the fol
71次阅读

LeetCode ||& Word Break && Word Break II(转)——动态规划

一、Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or
71次阅读

LeetCode 95. Unique Binary Search Trees II

题目如下: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 sh
92次阅读

LeetCode 96. Unique Binary Search Trees

题目入下:Given n, how many structurally unique BST's (binary search trees) that store values 1...n?For example,Given n = 3, there are a total of 5 unique
91次阅读

LeetCode 91. Decode Ways

题目入下:A message containing letters from A-Z is being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an encod
80次阅读

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 p
99次阅读

LeetCode 63. Unique Paths II

题目如下:Follow up for "Unique Paths":Now consider if some obstacles are added to the grids. How many unique paths would there be?An obstacle and empty sp
78次阅读