![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
题
胡思先生
这个作者很懒,什么都没留下…
展开
-
C++:反转字符串
class Solution { public: string reverseString(string s) { if(s[0] == NULL)//空返回 return s; int begin = 0;//设置头指针 int end = s.size() - 1;//设置尾指针 whil...原创 2019-01-20 17:57:50 · 136 阅读 · 0 评论 -
C++:字符串中的第一个唯一字符
两种方法:时间复杂度为O(n²)和时间复杂度为O(n)的 第一种: class Solution { public: int firstUniqChar(string s) { if(s[0] == NULL) return -1; for(int i = 0; i<s.size(); i++) { ...原创 2019-01-21 15:13:27 · 1555 阅读 · 0 评论