题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5202 题目意思:给出一个长度为 n,只有小写字母和 ? 组成的字符串.现在需要向 ? 的位置填小写字母,使得最终得到的字符串是字典序最小且不是回文串.如果怎么填都不符合结果,则输出 "QwQ". 首先我大体的解决思路是正确的. 先考虑最简单的情况,有可能整个字符串都不含 “?”.那么如果它不是回文串,就符合题目条件,否则输出"QwQ" 然后考虑有 “?” 的情况.我单纯…
[LeetCode]481. Magical String 解题报告(Python) 标签(空格分隔): LeetCode 作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 题目地址:https://leetcode.com/problems/magical-string/description/ 题目描述: A magical string S consists of only '1' and '2' and obeys the f…
[LeetCode]833. Find And Replace in String 解题报告(Python) 标签(空格分隔): LeetCode 作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 题目地址:https://leetcode.com/problems/find-and-replace-in-string/description/ 题目描述: To some string S, we will perform some…
[LeetCode]678. Valid Parenthesis String 解题报告(Python) 标签(空格分隔): LeetCode 作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.me/ 题目地址:https://leetcode.com/problems/valid-parenthesis-string/description/ 题目描述: Given a string containing only three types…
作者: 负雪明烛 id: fuxuemingzhu 个人博客:http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 统计字符串出现的次数 日期 题目地址:https://leetcode-cn.com/problems/construct-binary-tree-from-string/ 题目描述 You need to construct a binary tree from a string consisting of parenthesis and integ…
作者: 负雪明烛 id: fuxuemingzhu 个人博客:http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 遍历 日期 题目地址:https://leetcode-cn.com/problems/index-pairs-of-a-string/ 题目描述 Given a text string and words (a list of strings), return all index pairs [i, j] so that the substring…
作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 使用栈 双指针 日期 [LeetCode] 题目地址:https://leetcode.com/problems/reverse-vowels-of-a-string/ Total Accepted: 7758 Total Submissions: 22132 Difficulty: Easy 题目描述 Write a function that t…
作者: 负雪明烛 id: fuxuemingzhu 个人博客:http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 遍历 日期 题目地址:https://leetcode-cn.com/problems/bold-words-in-string/ 题目描述 Given a set of keywords words and a string S, make all appearances of all keywords in S bold. Any letters…
作者: 负雪明烛 id: fuxuemingzhu 个人博客:http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 遍历 日期 题目地址:https://leetcode-cn.com/problems/add-bold-tag-in-string/ 题目描述 Given a string s and a list of strings dict, you need to add a closed pair of bold tag <b> and </b&g…
作者: 负雪明烛 id: fuxuemingzhu 个人博客:http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 判断字符是否是aeiou 日期 题目地址:https://leetcode-cn.com/problems/remove-vowels-from-a-string/ 题目描述 Given a string S, remove the vowels 'a', 'e', 'i', 'o', and 'u' from it, and return the n…