![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Leetcode
文章平均质量分 58
czdachao
这个作者很懒,什么都没留下…
展开
-
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" is not a palin...2013-01-25 23:34:20 · 64 阅读 · 0 评论 -
Distinct Subsequences
Given a string S and a string T, count the number of distinct subsequences of T in S. A subsequence of a string is a new string which is formed from the original string by deleting some (can be none...原创 2013-01-29 15:03:21 · 85 阅读 · 0 评论 -
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 be any binary tree? Would your previous solution still work? Note: You may only use constant e...2013-01-29 13:52:14 · 97 阅读 · 0 评论 -
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 ...2013-01-29 11:33:08 · 80 阅读 · 0 评论 -
Pascal's 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]. Note:Could you optimize your algorithm to use only O(k) extra space? import java.util.Arr...原创 2013-01-28 23:16:02 · 70 阅读 · 0 评论 -
Pascal's 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] ] public class Solution...2013-01-28 17:19:48 · 52 阅读 · 0 评论 -
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 [ [2], [3,4], [...2013-01-28 15:31:29 · 84 阅读 · 0 评论 -
Best Time to Buy and Sell Stock II
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 complete as many transactions as you like (ie, buy on...原创 2013-01-26 14:40:21 · 58 阅读 · 0 评论 -
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 were only permitted to complete at most one transaction (ie, buy one and sell one share of the stock), ...原创 2013-01-26 14:31:47 · 79 阅读 · 0 评论 -
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 example:Given the below binary tree, 1 / \ 2 3 Return 6. ...2013-01-26 11:33:14 · 68 阅读 · 0 评论 -
Flatten Binary Tree to Linked List
Given a binary tree, flatten it to a linked list in-place. For example,Given 1 / \ 2 5 / \ \ 3 4 6 The flattened tree should look like: 1 ...2013-01-29 15:34:56 · 76 阅读 · 0 评论