摘要:
class Solution { public: int binaryGap(int N) { int position = 0; vector V; while (N) { if (N & 1)//N&1==1,表示最后一位是1 { V.pus... 阅读全文
摘要:
class Solution { public: int numSpecialEquivGroups(vector& A) { set ST; for (auto a : A) { vector V1; vector V2; for (int i = 0; i < a... 阅读全文
摘要:
class Solution { public: int calPoints(vector& ops) { stack ST; int sum = 0; for (auto o : ops) { if (o == "C") { int n = S... 阅读全文
摘要:
本题经过一下午的思考,终于解出来了。使用的是层次遍历的思想。 阅读全文
摘要:
class Solution { public: void SplitString(const string& s, vector& v, const string& c) { string::size_type pos1, pos2; pos2 = s.find(c); pos1 = 0; while (strin... 阅读全文