11 2017 档案

摘要:``` / Source : https://oj.leetcode.com/problems/reorder list/ Given a singly linked list L: L0→L1→…→Ln 1→Ln, reorder it to: L0→Ln→L1→Ln 1→L2→Ln 2→… Yo 阅读全文
posted @ 2017-11-27 22:51 lacker 阅读(310) 评论(0) 推荐(0)
摘要:``` / Source : https://oj.leetcode.com/problems/linked list cycle/ Given a linked list, determine if it has a cycle in it. Follow up: Can you solve it 阅读全文
posted @ 2017-11-27 22:49 lacker 阅读(131) 评论(0) 推荐(0)
摘要:``` / Source : https://oj.leetcode.com/problems/linked list cycle ii/ Given a linked list, return the node where the cycle begins. If there is no cycl 阅读全文
posted @ 2017-11-27 22:49 lacker 阅读(178) 评论(0) 推荐(0)
摘要:``` import java.util.*; /** * Source : https://oj.leetcode.com/problems/word-break-ii/ * * Given a string s and a dictionary of words dict, add spaces in s to construct a sentence * where each wo... 阅读全文
posted @ 2017-11-27 08:31 lacker 阅读(268) 评论(0) 推荐(0)
摘要:``` import java.util.Arrays; import java.util.HashSet; import java.util.Set; /** * Source : https://oj.leetcode.com/problems/word-break/ * * * Given a string s and a dictionary of words dict, det... 阅读全文
posted @ 2017-11-27 08:30 lacker 阅读(156) 评论(0) 推荐(0)
摘要:``` import java.util.*; /** * * Source : https://oj.leetcode.com/problems/copy-list-with-random-pointer/ * * A linked list is given such that each node contains an additional random pointer * wh... 阅读全文
posted @ 2017-11-24 08:17 lacker 阅读(249) 评论(0) 推荐(0)
摘要:``` / Source : https://oj.leetcode.com/problems/single number ii/ Given an array of integers, every element appears three times except for one. Find t 阅读全文
posted @ 2017-11-23 21:52 lacker 阅读(242) 评论(0) 推荐(0)
摘要:``` / Source : https://oj.leetcode.com/problems/single number/ Given an array of integers, every element appears twice except for one. Find that singl 阅读全文
posted @ 2017-11-23 21:51 lacker 阅读(146) 评论(0) 推荐(0)
摘要:``` / Source : https://oj.leetcode.com/problems/candy/ There are N children standing in a line. Each child is assigned a rating value. You are giving 阅读全文
posted @ 2017-11-23 21:50 lacker 阅读(131) 评论(0) 推荐(0)
摘要:``` / Source : https://oj.leetcode.com/problems/gas station/ There are N gas stations along a circular route, where the amount of gas at station i is 阅读全文
posted @ 2017-11-22 08:19 lacker 阅读(145) 评论(0) 推荐(0)
摘要:``` import java.util.*; /** * Source : https://oj.leetcode.com/problems/clone-graph/ * * * Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors. * * OJ... 阅读全文
posted @ 2017-11-22 08:18 lacker 阅读(174) 评论(0) 推荐(0)
摘要:``` import java.util.ArrayList; import java.util.Arrays; import java.util.List; /** * Source : https://oj.leetcode.com/problems/palindrome-partitioning/ * * * Given a string s, partition s such t... 阅读全文
posted @ 2017-11-21 20:47 lacker 阅读(123) 评论(0) 推荐(0)
摘要:``` import java.util.Arrays; /** * * Source : https://oj.leetcode.com/problems/palindrome-partitioning-ii/ * * Given a string s, partition s such that every substring of the partition is a palind... 阅读全文
posted @ 2017-11-21 20:47 lacker 阅读(200) 评论(0) 推荐(0)
摘要:``` import java.util.Arrays; import java.util.Stack; / Source : https://oj.leetcode.com/problems/surrounded regions/ Given a 2D board containing 'X' a 阅读全文
posted @ 2017-11-21 20:23 lacker 阅读(163) 评论(0) 推荐(0)
摘要:``` import java.util.Stack; / Source : https://oj.leetcode.com/problems/sum root to leaf numbers/ Given a binary tree containing digits from 0 9 only, 阅读全文
posted @ 2017-11-21 08:30 lacker 阅读(199) 评论(0) 推荐(0)
摘要:``` import java.util.HashSet; import java.util.Set; / Source : https://oj.leetcode.com/problems/longest consecutive sequence/ Given an unsorted array 阅读全文
posted @ 2017-11-21 08:29 lacker 阅读(163) 评论(0) 推荐(0)
摘要:``` import java.util.*; /** * Source : https://oj.leetcode.com/problems/word-ladder-ii/ * * * Given two words (start and end), and a dictionary, find all shortest transformation * sequence(s) fr... 阅读全文
posted @ 2017-11-20 08:27 lacker 阅读(161) 评论(0) 推荐(0)
摘要:``` import java.util. ; / Source : https://oj.leetcode.com/problems/word ladder/ Given two words (start and end), and a dictionary, find the length of 阅读全文
posted @ 2017-11-20 08:26 lacker 阅读(163) 评论(0) 推荐(0)
摘要:``` / Source : https://oj.leetcode.com/problems/valid palindrome/ Given a string, determine if it is a palindrome, considering only alphanumeric chara 阅读全文
posted @ 2017-11-17 09:00 lacker 阅读(139) 评论(0) 推荐(0)
摘要:``` / Source : https://oj.leetcode.com/problems/binary tree maximum path sum/ Given a binary tree, find the maximum path sum. The path may start and e 阅读全文
posted @ 2017-11-17 00:03 lacker 阅读(196) 评论(0) 推荐(0)
摘要:``` /** * 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/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 阅读(106) 评论(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)
摘要:``` 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 阅读(125) 评论(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 阅读(182) 评论(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)
摘要:``` import java.util.Stack; / Source : https://oj.leetcode.com/problems/symmetric tree/ Given a binary tree, check whether it is a mirror of itself (i 阅读全文
posted @ 2017-11-09 00:45 lacker 阅读(197) 评论(0) 推荐(0)
摘要:``` import java.util.Stack; / Source : https://oj.leetcode.com/problems/same tree/ Given two binary trees, write a function to check if they are equal 阅读全文
posted @ 2017-11-08 08:20 lacker 阅读(153) 评论(0) 推荐(0)
摘要:``` import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; /** * Source : https://oj.leetcode.com/problems/recover-binary-search-tree/ * * * Two... 阅读全文
posted @ 2017-11-08 08:18 lacker 阅读(177) 评论(0) 推荐(0)
摘要:``` import apple.laf.JRSUIUtils; / Source : https://oj.leetcode.com/problems/validate binary search tree/ Given a binary tree, determine if it is a va 阅读全文
posted @ 2017-11-06 08:21 lacker 阅读(268) 评论(0) 推荐(0)
摘要:``` / Source : https://oj.leetcode.com/problems/interleaving string/ Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2. For 阅读全文
posted @ 2017-11-06 08:20 lacker 阅读(181) 评论(0) 推荐(0)
摘要:``` import java.util.ArrayList; import java.util.Arrays; import java.util.Calendar; import java.util.List; / https://leetcode.com/problems/unique bina 阅读全文
posted @ 2017-11-05 19:36 lacker 阅读(246) 评论(0) 推荐(0)
摘要:``` / Source : https://oj.leetcode.com/problems/unique binary search trees/ Given n, how many structurally unique BST's (binary search trees) that sto 阅读全文
posted @ 2017-11-05 19:35 lacker 阅读(126) 评论(0) 推荐(0)
摘要:```java import java.util.Arrays; import java.util.Stack; import java.util.TreeMap; / Source : https://oj.leetcode.com/problems/binary tree inorder tra 阅读全文
posted @ 2017-11-05 19:34 lacker 阅读(150) 评论(0) 推荐(0)
摘要:``` import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; /** * Source : https://oj.leetcode.com/problems/restore-ip-addresses/ * * * * Given a... 阅读全文
posted @ 2017-11-05 19:30 lacker 阅读(174) 评论(0) 推荐(0)
摘要:``` / Source : https://oj.leetcode.com/problems/reverse linked list ii/ Reverse a linked list from position m to n. Do it in place and in one pass. Fo 阅读全文
posted @ 2017-11-02 22:25 lacker 阅读(163) 评论(0) 推荐(0)
摘要:``` / Source : https://leetcode.com/problems/reverse linked list/ Reverse a singly linked list. click to show more hints. Hint: A linked list can be r 阅读全文
posted @ 2017-11-02 22:24 lacker 阅读(137) 评论(0) 推荐(0)
摘要:``` / Source : https://oj.leetcode.com/problems/decode ways/ A message containing letters from A Z is being encoded to numbers using the following map 阅读全文
posted @ 2017-11-02 22:23 lacker 阅读(190) 评论(0) 推荐(0)