随笔分类 -  leetcode

1 2 3 4 5 ··· 7 下一页
摘要:``` / 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 阅读(305) 评论(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 阅读(175) 评论(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 阅读(129) 评论(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 阅读(266) 评论(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 阅读(155) 评论(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 阅读(242) 评论(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 阅读(240) 评论(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 阅读(141) 评论(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 阅读(129) 评论(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 阅读(140) 评论(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 阅读(170) 评论(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 阅读(120) 评论(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 阅读(198) 评论(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 阅读(160) 评论(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 阅读(195) 评论(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 阅读(161) 评论(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 阅读(159) 评论(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 阅读(161) 评论(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 阅读(136) 评论(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 阅读(193) 评论(0) 推荐(0)

1 2 3 4 5 ··· 7 下一页