摘要:
代码: #include<iostream>#include<stack> using namespace std; class ListNode{public: int m_nKey; ListNode* m_pNext; ListNode(int data):m_pNext(nullptr){ 阅读全文
摘要:
代码: #include<iostream>#include<string> using namespace std; class Solution{public: string ReplaceBlank(string s) { int count=0; int len = s.size(); fo 阅读全文
摘要:
相当于C++的:for( int i = 0; i < s.length(); i++){ s[i]....} 使用 for (char c : s) 时会复制一个s字符串再进行遍历操作,而使用 for (char& c : s) 时直接引用原字符串进行遍历操作,由于复制一个字符串花费了大量的时间, 阅读全文