String
weixin_39145266
这个作者很懒,什么都没留下…
展开
-
937 Reorder Data in Log Files
1 题目You have an array oflogs. Each log is a space delimited string of words.For each log, the first word in each log is an alphanumericidentifier. Then, either:Each word after the identifier...原创 2019-11-21 10:43:46 · 196 阅读 · 0 评论 -
165 Compare Version Numbers
1 题目Compare two version numbers version1 and version2.If version1 > version2 return 1; if version1 < version2 return -1;otherwise return 0.You may assume that the version strings are non-e...原创 2019-04-22 13:51:39 · 38 阅读 · 0 评论 -
71 Simplify Path
1 题目Given an absolute path for a file (Unix-style), simplify it. Or in other words, convert it to the canonical path.In a UNIX-style file system, a period . refers to the current directory. Furth...原创 2019-04-15 14:05:35 · 65 阅读 · 0 评论 -
227 Basic Calculator II
1 题目Implement a basic calculator to evaluate a simple expression string.The expression string contains only non-negative integers, +, -, *, / operators and empty spaces . The integer division sho...原创 2019-04-24 11:19:59 · 92 阅读 · 0 评论 -
125 Valid Palindrome
1 题目Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.Note:For the purpose of this problem, we define empty string as valid palindrome....原创 2019-05-06 15:02:05 · 62 阅读 · 0 评论 -
14 Longest Common Prefix
1 题目Write a function to find the longest common prefix string amongst an array of strings.If there is no common prefix, return an empty string"".Example 1:Input: ["flower","flow","flight"]O...原创 2019-05-06 16:02:02 · 58 阅读 · 0 评论 -
387 First Unique Character in a String
1 题目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:Yo...原创 2019-05-07 16:08:04 · 61 阅读 · 0 评论 -
383 Ransom Note
1 题目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 constructed from the magazine...原创 2019-05-07 16:34:40 · 420 阅读 · 0 评论 -
647 Palindromic Substrings
1 题目Given a string, your task is to count how many palindromic substrings in this string.The substrings with different start indexes or end indexes are counted as different substrings even they co...原创 2019-08-03 17:26:39 · 47 阅读 · 0 评论 -
43 Multiply Strings
1 题目Given two non-negative integersnum1andnum2represented as strings, return the product ofnum1andnum2, also represented as a string.Example 1:Input: num1 = "2", num2 = "3"Output: "6"...原创 2019-04-03 10:40:42 · 64 阅读 · 0 评论 -
17 Letter Combinations of a Phone Number
1 题目Given a string containing digits from2-9inclusive, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telephone buttons) ...原创 2019-03-29 09:17:50 · 89 阅读 · 0 评论 -
8 String to Integer (atoi)
1 题目Implementatoiwhichconverts a string to an integer.The function first discards as many whitespace characters as necessary until the first non-whitespace character is found. Then, starting fr...原创 2019-03-29 09:16:08 · 58 阅读 · 0 评论 -
12 Integer to Roman
1 题目Roman numerals are represented by seven different symbols:I,V,X,L,C,DandM.Symbol ValueI 1V 5X 10L 50C 100D ...原创 2019-03-29 09:16:25 · 43 阅读 · 0 评论 -
49 Group Anagrams
1 题目Given an array of strings, group anagrams together.2 尝试解class Solution {public: vector<vector<string>> groupAnagrams(vector<string>& strs) { map<string...原创 2019-03-29 09:19:12 · 59 阅读 · 0 评论 -
6 ZigZag Conversion
1 题目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...原创 2019-03-29 09:17:34 · 56 阅读 · 0 评论 -
22 Generate Parentheses
1 题目Givennpairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, givenn= 3, a solution set is:[ "((()))", "(()())", "(())()", "(...原创 2019-04-05 13:11:30 · 68 阅读 · 0 评论 -
151 Reverse Words in a String
1 题目Given an input string, reverse the string word by word.Example 1:Input: "the sky is blue"Output:"blue is sky the"Example 2:Input: " hello world! "Output:"world! hello"Explan...原创 2019-04-05 14:56:46 · 61 阅读 · 0 评论 -
93 Restore IP Addresses
1 题目Given a string containing only digits, restore it by returning all possible valid IP address combinations.Example:Input: "25525511135"Output: ["255.255.11.135", "255.255.111.35"]2 尝试解...原创 2019-04-10 16:48:09 · 62 阅读 · 0 评论 -
91 Decode Ways
1 题目A message containing letters fromA-Zis being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given anon-emptystring containing only digits, deter...原创 2019-03-29 09:18:25 · 80 阅读 · 0 评论 -
5 Longest Palindromic Substring
1 题目Given a strings, find the longest palindromic substring ins. You may assume that the maximum length ofsis 1000.Example 1:Input: "babad"Output: "bab"Note: "aba" is also a valid answer....原创 2019-03-29 09:16:34 · 54 阅读 · 0 评论