上一页 1 2 3 4 5 6 7 ··· 11 下一页
方法:在栈中直接记录字符串的下标更加方便 Read More
posted @ 2017-04-30 09:50 chengcy Views(90) Comments(0) Diggs(0)
方法:直接使用栈的数据结构对相关字符处理即可 Read More
posted @ 2017-04-26 08:41 chengcy Views(101) Comments(0) Diggs(0)
方法:最简单的是从后向前遍历即可 Read More
posted @ 2017-04-25 21:51 chengcy Views(95) Comments(0) Diggs(0)
方法:这里实际只需要处理".."和对应的字符 Read More
posted @ 2017-04-25 20:55 chengcy Views(125) Comments(0) Diggs(0)
Valid Anagram:注意所有字符都需要利用到 Read More
posted @ 2017-04-23 16:46 chengcy Views(86) Comments(0) Diggs(0)
class Solution { public: string countAndSay(int n) { string ret = "1"; for(int i=1; i<n; ++i) ret = generateNext(ret); return ret; } string genera... Read More
posted @ 2017-04-23 12:25 chengcy Views(99) Comments(0) Diggs(0)
方法:注意罗马数字的分布即可 Roman to Integer规则: Read More
posted @ 2017-04-23 11:46 chengcy Views(184) Comments(0) Diggs(0)
方法:最每一个子串分别遍历,取最长子串 Read More
posted @ 2017-04-23 10:44 chengcy Views(95) Comments(0) Diggs(0)
方法:与substring的不同是这里不需要子串连续 或者 Read More
posted @ 2017-04-22 22:57 chengcy Views(200) Comments(0) Diggs(0)
class Solution { public: int longestPalindrome(string s) { unordered_map hashTable; for(int i=0; i::iterator iter; bool flag = false; for(iter = hashTable.begin();... Read More
posted @ 2017-04-22 21:19 chengcy Views(95) Comments(0) Diggs(0)
上一页 1 2 3 4 5 6 7 ··· 11 下一页