Given a string S and a string T, count the number of distinct subsequences of T in&nb…
标签:LeetCode题目解答汇总
LeetCode | Populating Next Right Pointers in Each Node II(将每一层链接成一个链表)
Follow up for problem “Populating Next Right Pointers in Each Node“. What if the given tree could …
LeetCode | Pascal's Triangle(杨辉三角)
Given numRows, generate the first numRows of Pascal’s triangle. For example, given n…
LeetCode | Triangle(三角形路径和)
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on …
LeetCode | Best Time to Buy and Sell Stock(股票购买和抛售问题)
Say you have an array for which the ith element is the price of a given stock on day i. If you …
LeetCode | Best Time to Buy and Sell Stock II(股票购买抛售问题II)
Say you have an array for which the ith element is the price of a given stock on day i. Design …
LeetCode | Binary Tree Maximum Path Sum(二叉树的路径最大值)
Given a binary tree, find the maximum path sum. The path may start and end at any node in the tree. For exampl…
LeetCode | Valid Palindrome(有效的回文串)
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. …
LeetCode | Longest Consecutive Sequence(最长连续序列)
Given an unsorted array of integers, find the length of the longest consecutive elements sequence. For example…
LeetCode | Sum Root to Leaf Numbers(所有根结点到叶节点路径和的和)
Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number…
LeetCode | Palindrome Partitioning(将一个子串划分成回文子串)
Given a string s, partition s such that every substring of the partition is a palindrome. Retur…
LeetCode | Palindrome Partitioning II(最少切割次数将一个子串划分成回文子串)
Given a string s, partition s such that every substring of the partition is a palindrome. Retur…