上一页 1 ··· 84 85 86 87 88 89 90 91 92 ··· 114 下一页
摘要: class Solution { public: int calPoints(vector& ops) { stack ST; int sum = 0; for (auto o : ops) { if (o == "C") { int n = S... 阅读全文
posted @ 2018-09-28 18:27 Sempron2800+ 阅读(84) 评论(0) 推荐(0) 编辑
摘要: 本题经过一下午的思考,终于解出来了。使用的是层次遍历的思想。 阅读全文
posted @ 2018-09-28 17:34 Sempron2800+ 阅读(108) 评论(0) 推荐(0) 编辑
摘要: 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... 阅读全文
posted @ 2018-09-28 07:36 Sempron2800+ 阅读(105) 评论(0) 推荐(0) 编辑
摘要: 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... 阅读全文
posted @ 2018-09-27 22:40 Sempron2800+ 阅读(108) 评论(0) 推荐(0) 编辑
摘要: vector shortestToChar(string S, char C) { vector V; const int N = 10001; int AYC[N]; int countC = 0; for (int i = 0; i < S.size(); i++) { if (S[i] == C) { ... 阅读全文
posted @ 2018-09-27 22:14 Sempron2800+ 阅读(82) 评论(0) 推荐(0) 编辑
摘要: class Solution { public: vector v1; vector v2; void GetLeaf(TreeNode* tree, int type) { if (tree->left != NULL || tree->right != NULL) { if (tree->left != ... 阅读全文
posted @ 2018-09-27 20:41 Sempron2800+ 阅读(82) 评论(0) 推荐(0) 编辑
摘要: class Solution { public: TreeNode* searchBST(TreeNode* root, int val) { if (root == NULL) { return nullptr; } if (root->val == val) { ... 阅读全文
posted @ 2018-09-27 18:56 Sempron2800+ 阅读(121) 评论(0) 推荐(0) 编辑
摘要: vector numberOfLines(vector& widths, string S) { map MAP; MAP.insert(make_pair('a', widths[0])); MAP.insert(make_pair('b', widths[1])); MAP.insert(make_pair('c', widths[2])); MAP.... 阅读全文
posted @ 2018-09-27 18:46 Sempron2800+ 阅读(195) 评论(0) 推荐(0) 编辑
摘要: class Solution { public: ListNode* middleNode(ListNode* head) { if (head == NULL) { return nullptr; } vector List; List.push_back(head); ... 阅读全文
posted @ 2018-09-27 18:26 Sempron2800+ 阅读(110) 评论(0) 推荐(0) 编辑
摘要: int smallestRangeI(vector& A, int K) { int min = INT_MAX; int max = INT_MIN; for (auto a : A) { if (min > a) { min = a; } if (max 2 * K) ... 阅读全文
posted @ 2018-09-27 18:09 Sempron2800+ 阅读(89) 评论(0) 推荐(0) 编辑
上一页 1 ··· 84 85 86 87 88 89 90 91 92 ··· 114 下一页