字符串
共 12 篇文章
leetcode168. Excel表列名称
暂无摘要...
leetcode166. 分数到小数
暂无摘要...
leetcode165. 比较版本号
暂无摘要...
leetcode151. 颠倒字符串中的单词
暂无摘要...
leetcode5. 最长回文子串
暂无摘要...
leetcode131. 分割回文串
暂无摘要...
leetcode71. 简化路径
分析将path按照"/"拆分成字符串temp,如果temp为"."就什么都不干,为".."则弹出ans最后一个,其他情况则加入到ans中。class Solution {public: string simplifyPath(stri
leetcode67. 二进制求和
先将a,b逆置,然后再运算,最后再逆置即可。class Solution {public: string addBinary(string a, string b) { string ans; reverse(a.begin(),a.end()); r
leetcdoe58. 最后一个单词的长度
class Solution {public: int lengthOfLastWord(string s) { int ans=0,cur=s.length()-1; while(s[cur]==' '){ c
leetcode49. 字母异位词分组
分析string排序后的值相同的,可以使用字符串哈希将对应的字符串加进vector中,最后遍历哈希表,得到答案class Solution {public: vector<vector<string>> groupAnagrams(vector<string>