
String
文章平均质量分 58
所难
这个作者很懒,什么都没留下…
展开
-
LeetCode-Implement strStr()
Implement strStr().Returns a pointer to the first occurrence of needle in haystack, or null if needle is not part of haystack.Solution:Code:原创 2014-08-17 18:44:38 · 302 阅读 · 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-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-Scramble String
Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible representation of s1 = "great": great / \ gr原创 2014-08-08 12:12:02 · 441 阅读 · 0 评论 -
LeetCode-Reverse Words in a String
Given an input string, reverse the string word by word.For example,Given s = "the sky is blue",return "blue is sky the".click to show clarification.Clarification:What constitutes原创 2014-07-28 11:02:49 · 605 阅读 · 0 评论 -
LeetCode-Evaluate Reverse Polish Notation
Evaluate the value of an arithmetic expression in Reverse Polish Notation.Valid operators are +, -, *, /. Each operand may be an integer or another expression.Some examples: ["2", "1",原创 2014-07-28 11:09:27 · 292 阅读 · 0 评论 -
LeetCode-Restore IP Addresses
Given a string containing only digits, restore it by returning all possible valid IP address combinations.For example:Given "25525511135",return ["255.255.11.135", "255.255.111.35"]. (Order does原创 2014-08-06 22:23:15 · 342 阅读 · 0 评论 -
LeetCode-Interleaving String
Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.For example,Given:s1 = "aabcc",s2 = "dbbca",When s3 = "aadbbcbcac", return true.When s3 = "aadbbbaccc", ret原创 2014-08-06 10:54:32 · 256 阅读 · 0 评论 -
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-Longest Common Prefix
Write a function to find the longest common prefix string amongst an array of strings.Solution:Code:原创 2014-08-18 14:31:23 · 431 阅读 · 0 评论 -
LeetCode-String to Integer (atoi)
Implement atoi to convert a string to an integer.Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input ca原创 2014-08-18 21:31:39 · 319 阅读 · 0 评论 -
LeetCode-Substring with Concatenation of All Words
You are given a string, S, and a list of words, L, that are all of the same length. Find all starting indices of substring(s) in S that is a concatenation of each word in L exactly once and without an原创 2014-08-17 17:11:36 · 320 阅读 · 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 评论