摘要: 题意:给定一个字符串,可以最多去掉一个字符,判断是否可以使该字符串成为一个回文串。 分析:head和tail双指针分别指向字符串首尾,如果s[head] != s[tail],则要么去掉s[head],要么去掉s[tail],只需判断s[head + 1]~s[tail]或s[head]~s[tai 阅读全文
posted @ 2020-02-18 20:39 Somnuspoppy 阅读(149) 评论(0) 推荐(0)
摘要: 题意:给定一个字符串,反转字符串中的元音字母。 例如: Input: "leetcode" Output: "leotcede" 法一:双指针 class Solution { public: string reverseVowels(string s) { if(s == "") return " 阅读全文
posted @ 2020-02-18 10:45 Somnuspoppy 阅读(121) 评论(0) 推荐(0)