随笔分类 -  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 ... 阅读全文
posted @ 2017-11-15 08:51 lacker 阅读(318) 评论(0) 推荐(0)
摘要:``` /** * 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... 阅读全文
posted @ 2017-11-15 08:50 lacker 阅读(172) 评论(0) 推荐(0)
摘要:``` /** * 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... 阅读全文
posted @ 2017-11-15 08:49 lacker 阅读(125) 评论(0) 推荐(0)
摘要:``` / 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 阅读全文
posted @ 2017-11-15 08:49 lacker 阅读(107) 评论(0) 推荐(0)
摘要:``` 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 ... 阅读全文
posted @ 2017-11-14 08:26 lacker 阅读(124) 评论(0) 推荐(0)
摘要:``` import java.util.ArrayList; import java.util.Arrays; import java.util.List; / Source : https://oj.leetcode.com/problems/pascals triangle/ Given nu 阅读全文
posted @ 2017-11-14 08:25 lacker 阅读(126) 评论(0) 推荐(0)
摘要:``` / Source : https://oj.leetcode.com/problems/populating next right pointers in each node/ Source : https://oj.leetcode.com/problems/populating next 阅读全文
posted @ 2017-11-14 08:24 lacker 阅读(212) 评论(0) 推荐(0)
摘要:``` 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 阅读全文
posted @ 2017-11-13 08:18 lacker 阅读(195) 评论(0) 推荐(0)
摘要:``` 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... 阅读全文
posted @ 2017-11-13 08:17 lacker 阅读(138) 评论(0) 推荐(0)
摘要:``` 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-... 阅读全文
posted @ 2017-11-12 22:35 lacker 阅读(149) 评论(0) 推荐(0)
摘要:``` / 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 阅读全文
posted @ 2017-11-12 22:34 lacker 阅读(141) 评论(0) 推荐(0)
摘要:``` / 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 阅读全文
posted @ 2017-11-10 08:18 lacker 阅读(122) 评论(0) 推荐(0)
摘要:``` / Source : https://oj.leetcode.com/problems/balanced binary tree/ Given a binary tree, determine if it is height balanced. For this problem, a hei 阅读全文
posted @ 2017-11-10 08:17 lacker 阅读(183) 评论(0) 推荐(0)
摘要:``` 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... 阅读全文
posted @ 2017-11-09 21:58 lacker 阅读(184) 评论(0) 推荐(0)
摘要:``` 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... 阅读全文
posted @ 2017-11-09 21:57 lacker 阅读(147) 评论(0) 推荐(0)
摘要:``` 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/ * * *... 阅读全文
posted @ 2017-11-09 08:18 lacker 阅读(222) 评论(0) 推荐(0)
摘要:``` 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... 阅读全文
posted @ 2017-11-09 08:18 lacker 阅读(210) 评论(0) 推荐(0)
摘要:``` / 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 阅读全文
posted @ 2017-11-09 00:48 lacker 阅读(118) 评论(0) 推荐(0)
摘要:``` import java.util.ArrayList; import java.util.Arrays; import java.util.List; / Source : https://oj.leetcode.com/problems/binary tree zigzag level o 阅读全文
posted @ 2017-11-09 00:47 lacker 阅读(146) 评论(0) 推荐(0)
摘要:``` import org.lep.leetcode.binarytreeinordertraversal.BinaryTreeInOrderTraversal; import java.util.ArrayList; import java.util.Arrays; import java.ut 阅读全文
posted @ 2017-11-09 00:46 lacker 阅读(187) 评论(0) 推荐(0)