
String
文章平均质量分 71
dyllanzhou
这个作者很懒,什么都没留下…
展开
-
[Leetcode]Group Anagrams
Given an array of strings, group anagrams together.For example, given: ["eat", "tea", "tan", "ate", "nat", "bat"], Return:[ ["ate", "eat","tea"], ["nat","tan"], ["bat"]]Note:For t原创 2015-11-05 15:08:52 · 251 阅读 · 0 评论 -
[Leetcode]Ransom Note
Given an arbitrary ransom note string and another string containing letters from all the magazines, write a function that will return true if the ransom note can be construc原创 2016-08-22 15:17:32 · 480 阅读 · 0 评论 -
[Leetcode]Edit Distance
Given two words word1 and word2, find the minimum number of steps required to convertword1 to word2. (each operation is counted as 1 step.)You have the following 3 operations permitted on a word:原创 2016-01-18 14:41:11 · 313 阅读 · 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".Update (2015-02-12):For C programmers: Try to solve it in-place in O(1原创 2015-11-18 00:08:17 · 270 阅读 · 0 评论 -
[Leetcode]Simplify Path
Given an absolute path for a file (Unix-style), simplify it.For example,path = "/home/", => "/home"path = "/a/./b/../../c/", => "/c"class Solution {public: /*algorithm for simplici原创 2015-11-14 22:06:12 · 272 阅读 · 0 评论 -
[Leetcode]Longest Substring Without Repeating Characters
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which the length is 3. For原创 2015-11-14 16:57:23 · 248 阅读 · 0 评论 -
[Leetcode]Letter Combinations of a Phone Number
Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telephone buttons) is given below.Input:Digit string原创 2015-10-27 21:34:48 · 346 阅读 · 0 评论 -
[Leetcode] Longest Palindromic Substring
Given a string S, find the longest palindromic substring in S. You may assume that the maximum length ofS is 1000, and there exists one unique longest palindromic substring.class Solution {public原创 2015-11-13 16:49:15 · 174 阅读 · 0 评论 -
[Leetcode]Multiply Strings
Given two numbers represented as strings, return multiplication of the numbers as a string.Note: The numbers can be arbitrarily large and are non-negative.class Solution {public: /*algorithm原创 2015-11-13 15:14:15 · 218 阅读 · 0 评论 -
[Leetcode] Integer to Roman
Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999./*roman background Symbol Value I 1 V 5 X 10 L 50 C原创 2015-09-22 19:09:55 · 321 阅读 · 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原创 2015-11-12 11:59:16 · 203 阅读 · 0 评论 -
[Leetcode]First Unique Character in a String
Given a string, find the first non-repeating character in it and return it's index. If it doesn't exist, return -1.Examples:s = "leetcode"return 0.s = "loveleetcode",return 2.Note: You may原创 2016-08-22 15:25:56 · 495 阅读 · 0 评论