Sara

  • Home

  • Tags

  • Categories

  • Archives

  • Search

LeetCode_Best Time to Buy and Sell Stock III

Posted on 2019-03-12 | Edited on 2019-03-13 | In LeetCode

Best Time to Buy and Sell Stock III

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 two transactions.
(股票收益)

Read more »

LeetCode_Best Time to Buy and Sell Stock II

Posted on 2019-03-12 | Edited on 2019-03-13 | In LeetCode

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 (i.e., buy one and sell one share of the stock multiple times).
(股票收益)

Read more »

LeetCode_Best Time to Buy and Sell Stock

Posted on 2019-03-12 | Edited on 2019-03-13 | In 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 were only permitted to complete at most one transaction (i.e., buy one and sell one share of the stock), design an algorithm to find the maximum profit. Note that you cannot sell a stock before you buy one.
(股票收益)

Read more »

LeetCode_Triangle

Posted on 2019-03-11 | In LeetCode

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.
(计算三角矩阵的最短路径)

Read more »

LeetCode_Pascal's Triangle II

Posted on 2019-03-11 | In LeetCode

Pascal’s Triangle II

Given a non-negative index k where k ≤ 33, return the k_th index row of the Pascal’s triangle. Note that the row index starts from 0.
(第k行杨辉三角)

Read more »

LeetCode_Pascal's Triangle

Posted on 2019-03-11 | In LeetCode

Pascal’s Triangle

Given a non-negative integer numRows, generate the first numRows of Pascal’s triangle.
(杨辉三角)

Read more »

LeetCode_Populating Next Right Pointers in Each Node II

Posted on 2019-03-06 | Edited on 2019-03-09 | In LeetCode

Populating Next Right Pointers in Each Node II

Given a binary tree, Populate each next pointer to point to its next right node. If there is no next right node, the next pointer should be set to NULL. Initially, all next pointers are set to NULL.
(连接二叉树同一层的结点)

Read more »

LeetCode_Populating Next Right Pointers in Each Node

Posted on 2019-03-05 | Edited on 2019-03-09 | In LeetCode

Populating Next Right Pointers in Each Node

You are given a perfect binary tree where all leaves are on the same level, and every parent has two children. Populate each next pointer to point to its next right node. If there is no next right node, the next pointer should be set to NULL. Initially, all next pointers are set to NULL.
(连接完全二叉树同一层的结点)

Read more »

LeetCode_Distinct Subsequences

Posted on 2019-03-05 | In LeetCode

Distinct Subsequences

Given a string S and a string T, count the number of distinct subsequences of S which equals T. A subsequence of a string is a new string which is formed from the original string by deleting some (can be none) of the characters without disturbing the relative positions of the remaining characters. (ie, “ACE” is a subsequence of “ABCDE” while “AEC” is not).
(有效子序列个数)

Read more »

LeetCode_Flatten Binary Tree to Linked List

Posted on 2019-03-05 | In LeetCode

Flatten Binary Tree to Linked List

Given a binary tree, flatten it to a linked list in-place.
(压平二叉树)

Read more »
1…8910…21

Sara Han

207 posts
4 categories
40 tags
© 2019 Sara Han
Powered by Hexo v3.8.0
|
Theme – NexT.Mist v6.4.2