摘要:
1 class Solution 2 { 3 public: 4 int minFlipsMonoIncr(string S) 5 { 6 vector left2CountOne (S.size(),0); 7 vector right2CountZero (S.size(),0); 8 ... 阅读全文
摘要:
1 class Solution 2 { 3 public: 4 int getWordEnd; 5 string getWord(string str) 6 { 7 string tmp; 8 int i; 9 for(i = getWordEnd;... 阅读全文
摘要:
1 class Solution 2 { 3 public: 4 int candy(vector& ratings) 5 { 6 int result = 0; 7 vector v1 (ratings.size(),1); 8 vector v2 (ratings.... 阅读全文
摘要:
1 class Solution 2 { 3 private: 4 int visited[309]; 5 int nowKilled; 6 int numOfNode; 7 int toBeDeleted; 8 public: 9 void DFS(int killer,vecto... 阅读全文
摘要:
1 class Solution 2 { 3 private: 4 int hashList[102]; 5 public: 6 long long int get(long long int n,long long int m) 7 { 8 if(m==1) 9 ... 阅读全文
摘要:
1 class Solution 2 { 3 public: 4 int minAddToMakeValid(string S) 5 { 6 stack s; 7 int result = 0; 8 for(auto c:S) 9 { 10 ... 阅读全文
摘要:
1 class Solution 2 { 3 public: 4 vector sortArrayByParityII(vector& A) 5 { 6 stack oddList; 7 stack evenList; 8 9 for(aut... 阅读全文
摘要:
1 int x[] = {1,-1,0,0}; 2 int y[] = {0,0,1,-1}; 3 4 class Solution 5 { 6 private: 7 int acreList[1500]; 8 int acreListEnd; 9 int Maxresult; 10 ... 阅读全文
摘要:
1 class Solution 2 { 3 public: 4 bool isToeplitzMatrix(vector>& matrix) 5 { 6 bool result = true; 7 for(int i = matrix.size()-1;i >= 0;i --) 8 ... 阅读全文
摘要:
哔了狗,一直忘记vector开辟空间以后会把所有元素的地址进行变动,然后疯狂debug 阅读全文