leetcode-java
chengyunyi123
滴水穿石,非一日之功
展开
-
LeetCode - linked-list-cycle-ii
题目描述: Given a linked list, return the node where the cycle begins. If there is no cycle, returnnull. Follow up: Can you solve it without using extra space? 时间限制:1秒 空间限制:32768K 思路: 1)使用快慢指原创 2017-08-08 13:30:04 · 201 阅读 · 0 评论 -
LeetCode - Binary-Tree-Preorder-Traversal
题目描述 Given a binary tree, return the preorder traversal of its nodes’ values. For example: Given binary tree{1,#,2,3}, 1 \ 2 / 3 return[1,2,3]. Note: Re原创 2017-08-08 15:05:12 · 196 阅读 · 0 评论 -
LeetCode - Binary-Tree-Postorder-Traversal
题目描述 Given a binary tree, return the postorder traversal of its nodes’ values. For example: Given binary tree{1,#,2,3}, 1 \ 2 / 3 return[3,2,1]./** * D原创 2017-08-08 15:06:43 · 183 阅读 · 0 评论 -
LeetCode - Word-Break
题目描述 Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words. For example, given s =”leetcode”, di原创 2017-08-08 16:48:38 · 229 阅读 · 0 评论 -
LeetCode - Two Sum
Question: Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution, and you may no原创 2017-08-09 10:14:54 · 294 阅读 · 0 评论 -
LeetCode - Longest Substring Without Repeating Characters
Given a string, find the length of the longest substring without repeating characters. Examples: Given “abcabcbb”, the answer is “abc”, which the length is 3. Given “bbbbb”, the answer i原创 2017-08-10 12:39:58 · 342 阅读 · 0 评论 -
Leetcode - Longest Palindromic Substring
Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example: Input: “babad” Output: “bab” Note: “aba” is also a valid ans原创 2017-08-23 15:35:43 · 349 阅读 · 0 评论 -
LeetCode- Three Sum
Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero. Note: The solution set must not contain原创 2017-08-28 17:32:46 · 324 阅读 · 0 评论