
Level 1
文章平均质量分 67
所难
这个作者很懒,什么都没留下…
展开
-
LeetCode-Regular Expression Matching
Implement regular expression matching with support for '.' and '*'.'.' Matches any single character.'*' Matches zero or more of the preceding element.The matching should cover the entire input st原创 2014-08-18 19:55:07 · 707 阅读 · 0 评论 -
LeetCode-Distinct Subsequences
Given a string S and a string T, count the number of distinct subsequences of T in S.A subsequence of a string is a new string which is formed from the original string by deleting some (can be non原创 2014-08-03 13:28:07 · 354 阅读 · 0 评论 -
LeetCode-Populating Next Right Pointers in Each Node II
Follow up for problem "Populating Next Right Pointers in Each Node".What if the given tree could be any binary tree? Would your previous solution still work?Note:You may only use constant原创 2014-08-03 12:42:44 · 352 阅读 · 0 评论 -
LeetCode-Surrounded Regions
Given a 2D board containing 'X' and 'O', capture all regions surrounded by 'X'.A region is captured by flipping all 'O's into 'X's in that surrounded region.For example,X X X XX O O X原创 2014-07-31 11:13:17 · 275 阅读 · 0 评论 -
LeetCode-Word Ladder
Given two words (start and end), and a dictionary, find the length of shortest transformation sequence from start to end, such that:Only one letter can be changed at a timeEach intermediate word m原创 2014-07-31 14:48:02 · 552 阅读 · 0 评论 -
LeetCode-Candy
There are N children standing in a line. Each child is assigned a rating value.You are giving candies to these children subjected to the following requirements:Each child must have at least on原创 2014-07-30 09:46:38 · 326 阅读 · 0 评论 -
LeetCode-Copy List with Random Pointer
A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null.Return a deep copy of the list.Solution:Code:/** * D原创 2014-07-29 16:25:10 · 398 阅读 · 0 评论 -
LeetCode-Word Break II
Given a string s and a dictionary of words dict, add spaces in s to construct a sentence where each word is a valid dictionary word.Return all such possible sentences.For example, givens = "原创 2014-07-29 15:37:05 · 560 阅读 · 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, givens = "leetcode",dict = ["leet"原创 2014-07-29 15:43:50 · 402 阅读 · 0 评论 -
LeetCode-Palindrome Partitioning II
Given a string s, partition s such that every substring of the partition is a palindrome.Return the minimum cuts needed for a palindrome partitioning of s.For example, given s = "aab",Return原创 2014-07-30 13:36:12 · 260 阅读 · 0 评论 -
LeetCode-Palindrome Partitioning
Given a string s, partition s such that every substring of the partition is a palindrome.Return all possible palindrome partitioning of s.For example, given s = "aab",Return [ ["aa","原创 2014-07-31 10:27:37 · 266 阅读 · 0 评论 -
LeetCode-Clone Graph
Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors.OJ's undirected graph serialization:Nodes are labeled uniquely.We use # as a separator for each原创 2014-07-30 10:52:59 · 403 阅读 · 0 评论 -
LeetCode-Max Points on a Line
Given n points on a 2D plane, find the maximum number of points that lie on the same straight line.原创 2014-07-28 12:49:51 · 428 阅读 · 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, and there exists one unique longest palindromic substring.Solution:Code:原创 2014-09-21 02:19:55 · 471 阅读 · 0 评论 -
LeetCode-Median of Two Sorted Arrays
There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).Solution:Code:class Solution原创 2014-08-19 14:55:39 · 388 阅读 · 0 评论 -
LeetCode-ZigZag Conversion
The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)P A H NA P L S I原创 2014-08-19 13:25:07 · 291 阅读 · 0 评论 -
LeetCode-Palindrome Number
Determine whether an integer is a palindrome. Do this without extra space.click to show spoilers.Some hints:Could negative integers be palindromes? (ie, -1)If you are thinking of convertin原创 2014-08-18 21:18:37 · 369 阅读 · 0 评论 -
LeetCode-Symmetric Tree
Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree is symmetric: 1 / \ 2 2 / \ / \3 4 4 3But the f原创 2014-08-04 15:18:11 · 362 阅读 · 0 评论