随笔分类 -  leetcode_string

leetcode中String类型题目解法
摘要:转自https://blog.csdn.net/qq_41056506/article/details/82659524 题目如下:输入一个字符串,按字典序打印出该字符串中字符的所有排列。例如输入字符串abc,则打印出由字符a,b,c所能排列出来的所有字符串abc,acb,bac,bca,cab和c 阅读全文
posted @ 2022-02-02 12:00 daniel456 阅读(207) 评论(0) 推荐(0) 编辑
摘要: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 c 阅读全文
posted @ 2017-10-18 15:47 daniel456 阅读(128) 评论(0) 推荐(0) 编辑
摘要:Given a list of directory info including directory path, and all the files with contents in this directory, you need to find out all the groups of dup 阅读全文
posted @ 2017-10-18 15:37 daniel456 阅读(130) 评论(0) 推荐(0) 编辑
摘要:Given two words word1 and word2, find the minimum number of steps required to make word1 and word2 the same, where in each step you can delete one cha 阅读全文
posted @ 2017-10-18 15:32 daniel456 阅读(198) 评论(0) 推荐(0) 编辑
摘要:Given a positive 32-bit integer n, you need to find the smallest 32-bit integer which has exactly the same digits existing in the integer nand is grea 阅读全文
posted @ 2017-10-18 15:04 daniel456 阅读(136) 评论(0) 推荐(0) 编辑
摘要:Given a list of positive integers, the adjacent integers will perform the float division. For example, [2,3,4] -> 2 / 3 / 4. However, you can add any 阅读全文
posted @ 2017-10-18 14:39 daniel456 阅读(178) 评论(0) 推荐(0) 编辑
摘要:Given a list of 24-hour clock time points in "Hour:Minutes" format, find the minimum minutes difference between any two time points in the list. Examp 阅读全文
posted @ 2017-10-18 14:01 daniel456 阅读(246) 评论(0) 推荐(0) 编辑
摘要:Given two strings representing two complex numbers. You need to return a string representing their multiplication. Note i2 = -1 according to the defin 阅读全文
posted @ 2017-10-18 13:54 daniel456 阅读(131) 评论(0) 推荐(0) 编辑
摘要:Implement a basic calculator to evaluate a simple expression string. The expression string contains only non-negative integers, +, -, *, / operators a 阅读全文
posted @ 2017-10-18 13:46 daniel456 阅读(119) 评论(0) 推荐(0) 编辑
摘要:Compare two version numbers version1 and version2.If version1 > version2 return 1, if version1 < version2 return -1, otherwise return 0. You may assum 阅读全文
posted @ 2017-10-18 13:44 daniel456 阅读(133) 评论(0) 推荐(0) 编辑
摘要:Given an input string, reverse the string word by word. For example,Given s = "the sky is blue",return "blue is sky the". 题目含义:翻转字符串中的单词的顺序,单词内容不变 阅读全文
posted @ 2017-10-18 10:55 daniel456 阅读(97) 评论(0) 推荐(0) 编辑
摘要:Given a string containing only digits, restore it by returning all possible valid IP address combinations. For example:Given "25525511135", return ["2 阅读全文
posted @ 2017-10-18 10:50 daniel456 阅读(140) 评论(0) 推荐(0) 编辑
摘要:A message containing letters from A-Z is being encoded to numbers using the following mapping: Given an encoded message containing digits, determine t 阅读全文
posted @ 2017-10-18 10:18 daniel456 阅读(137) 评论(0) 推荐(0) 编辑
摘要:Given an absolute path for a file (Unix-style), simplify it. For example,path = "/home/", => "/home"path = "/a/./b/../../c/", => "/c" 题目含义:简化unix路径 阅读全文
posted @ 2017-10-18 10:08 daniel456 阅读(97) 评论(0) 推荐(0) 编辑
摘要:Given an array of strings, group anagrams together. For example, given: ["eat", "tea", "tan", "ate", "nat", "bat"], Return: Note: All inputs will be i 阅读全文
posted @ 2017-10-18 10:05 daniel456 阅读(94) 评论(0) 推荐(0) 编辑
摘要:Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2. Note: 题目含义:计算两个非负整数的乘法,并用string返回 思路: 方法二: 阅读全文
posted @ 2017-10-17 17:05 daniel456 阅读(110) 评论(0) 推荐(0) 编辑
摘要:Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set is: 阅读全文
posted @ 2017-10-17 17:01 daniel456 阅读(110) 评论(0) 推荐(0) 编辑
摘要:Given a digit string, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on the telepho 阅读全文
posted @ 2017-10-17 16:55 daniel456 阅读(131) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2017-10-17 16:43 daniel456 阅读(100) 评论(0) 推荐(0) 编辑
摘要:Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example: Example: 阅读全文
posted @ 2017-10-17 16:38 daniel456 阅读(140) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示