- 博客(8)
- 资源 (1)
- 收藏
- 关注
原创 309. Best Time to Buy and Sell Stock with Cooldown
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
2017-03-21 07:09:16 171
原创 188. Best Time to Buy and Sell Stock IV
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 at most k transactions. Note: You may no
2017-03-21 05:39:35 247
原创 44. Wildcard Matching
Implement wildcard pattern matching with support for '?' and '*'. '?' Matches any single character. '*' Matches any sequence of characters (including the empty sequence). The matching should cover t
2017-03-17 05:46:03 340
原创 105. Construct Binary Tree from Preorder and Inorder Traversal
Given preorder and inorder traversal of a tree, construct the binary tree. Note: You may assume that duplicates do not exist in the tree. 这道题是利用一棵树的先序遍历,和中序遍历重建出一颗树,LeetCode中有一道相似的题目:106. Const
2017-03-17 01:17:21 309
原创 124. Binary Tree Maximum Path Sum
Given a binary tree, find the maximum path sum. For this problem, a path is defined as any sequence of nodes from some starting node to any node in the tree along the parent-child connections. The
2017-03-16 11:24:19 213
原创 461. Hamming Distance
The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Given two integers x and y, calculate the Hamming distance. Note: 0 ≤ x,
2017-03-16 10:02:57 255
原创 300. Longest Increasing Subsequence
Given an unsorted array of integers, find the length of longest increasing subsequence. For example, Given [10, 9, 2, 5, 3, 7, 101, 18], The longest increasing subsequence is [2, 3, 7, 101], ther
2017-03-16 07:24:13 190
原创 74. Search a 2D Matrix
Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: Integers in each row are sorted from left to right.The first integer of each
2017-03-15 08:54:27 199
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人