LeetCode--072--编辑距离(python)】的更多相关文章

题目来源 https://leetcode.com/problems/valid-palindrome/ Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example,"A man, a plan, a canal: Panama" is a palindrome."race a car"…
题目来源 https://leetcode.com/problems/triangle/ 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 following triangle [ [], [,4], [6,,7], [4,,8,3] ] The min…
题目来源 https://leetcode.com/problems/pascals-triangle-ii/ Given an index k, return the kth row of the Pascal's triangle. For example, given k = 3,Return [1,3,3,1]. 题意分析 Input:integer Output:kth row of the Pascal's triangle Conditions:只返回第n行 题目思路 同118,不…
题目来源 https://leetcode.com/problems/pascals-triangle/ Given numRows, generate the first numRows of Pascal's triangle. For example, given numRows = 5,Return [ [1], [1,1], [1,2,1], [1,3,3,1], [1,4,6,4,1] ] 题意分析 Input:integer Output:帕斯卡三角 Conditions:帕斯卡三…
题目来源 https://leetcode.com/problems/populating-next-right-pointers-in-each-node/ Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; } Populate each next pointer to point to its next right node. If th…
题目来源 https://leetcode.com/problems/flatten-binary-tree-to-linked-list/ Given a binary tree, flatten it to a linked list in-place. 题意分析 Input: binary tree Output: flattened tree Conditions:将一个二叉树压平为一个flatten 树,也就是一条斜线 题目思路 先将左右子树压平,然后将左子树嵌入到本节点与右子树之间.…
题目来源 https://leetcode.com/problems/path-sum-ii/ Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum. 题意分析 Input: a binary tree, sum Output: list of list. Conditions: 给定一个二叉树,将所有root-leaf的路径值和等于sum的路径返…
题目来源 https://leetcode.com/problems/path-sum/ Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum. 题意分析 Input: a binary tree, sum Output: True or False Con…
题目来源 https://leetcode.com/problems/minimum-depth-of-binary-tree/ Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node. 题意分析 Input: a binary tree…
题目来源 https://leetcode.com/problems/balanced-binary-tree/ Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every node never d…