随笔分类 - leetcode
摘要:``` /** * Source : https://oj.leetcode.com/problems/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 ...
阅读全文
摘要:``` /** * Source : https://oj.leetcode.com/problems/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. * * Desig...
阅读全文
摘要:``` / Source : https://oj.leetcode.com/problems/triangle/ Given a triangle, find the minimum path sum from top to bottom. Each step you may move to ad
阅读全文
摘要:``` /** * Source : https://oj.leetcode.com/problems/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...
阅读全文
摘要:``` import java.util.Arrays; /** * * Source : https://oj.leetcode.com/problems/pascals-triangle-ii/ * * * Given an index k, return the kth row of the Pascal's triangle. * * For example, given ...
阅读全文
摘要:``` import java.util.ArrayList; import java.util.Arrays; import java.util.List; / Source : https://oj.leetcode.com/problems/pascals triangle/ Given nu
阅读全文
摘要:``` / Source : https://oj.leetcode.com/problems/populating next right pointers in each node/ Source : https://oj.leetcode.com/problems/populating next
阅读全文
摘要:``` import java.util.Arrays; / Source : https://oj.leetcode.com/problems/distinct subsequences/ Given a string S and a string T, count the number of d
阅读全文
摘要:``` import java.util.ArrayList; import java.util.Arrays; import java.util.List; /** * Source : https://oj.leetcode.com/problems/flatten-binary-tree-to-linked-list/ * * * Given a binary tree, flat...
阅读全文
摘要:``` import java.util.ArrayList; import java.util.Arrays; import java.util.List; /** * Source : https://oj.leetcode.com/problems/path-sum-ii/ * * * Given a binary tree and a sum, find all root-to-...
阅读全文
摘要:``` / Source : https://oj.leetcode.com/problems/path sum/ Given a binary tree and a sum, determine if the tree has a root to leaf path such that addin
阅读全文
摘要:``` / Source : https://oj.leetcode.com/problems/minimum depth of binary tree/ Given a binary tree, find its minimum depth. The minimum depth is the nu
阅读全文
摘要:``` / Source : https://oj.leetcode.com/problems/balanced binary tree/ Given a binary tree, determine if it is height balanced. For this problem, a hei
阅读全文
摘要:``` import java.util.ArrayList; import java.util.Arrays; import java.util.List; /** * Source : https://oj.leetcode.com/problems/convert-sorted-list-to-binary-search-tree/ * * * Given a singly lin...
阅读全文
摘要:``` import java.util.ArrayList; import java.util.Arrays; import java.util.List; /** * * Source : https://oj.leetcode.com/problems/convert-sorted-array-to-binary-search-tree/ * * Given an array wh...
阅读全文
摘要:``` import java.util.ArrayList; import java.util.Arrays; import java.util.List; /** * * Source : https://oj.leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/ * * *...
阅读全文
摘要:``` import java.util.ArrayList; import java.util.Arrays; import java.util.List; /** * Source : https://oj.leetcode.com/problems/construct-binary-tree-from-inorder-and-postorder-traversal/ * * * G...
阅读全文
摘要:``` / Source : https://oj.leetcode.com/problems/maximum depth of binary tree/ Given a binary tree, find its maximum depth. The maximum depth is the nu
阅读全文
摘要:``` import java.util.ArrayList; import java.util.Arrays; import java.util.List; / Source : https://oj.leetcode.com/problems/binary tree zigzag level o
阅读全文
摘要:``` import org.lep.leetcode.binarytreeinordertraversal.BinaryTreeInOrderTraversal; import java.util.ArrayList; import java.util.Arrays; import java.ut
阅读全文

浙公网安备 33010602011771号