摘要:
题目描述 小明很喜欢数学,有一天他在做数学作业时,要求计算出9~16的和,他马上就写出了正确答案是100。但是他并不满足于此,他在想究竟有多少种连续的正数序列的和为100(至少包括两个数)。没多久,他就得到另一组连续正数和为100的序列:18,19,20,21,22。现在把问题交给你,你能不能也很快 阅读全文
摘要:
class Solution { public: int StrToInt(string str) { int flag,index=0; if(str[0]=='+'){ flag=1; index++; } if(str[0]=='-'){ ... 阅读全文
摘要:
class Solution { public: int rectCover(int number) { if (number == 0) return 0; else if (number == 1) return 1; else if (number == 2) return 2; ... 阅读全文
摘要:
class Solution { public: int Fibonacci(int n) { if (n != 0) { vector array; array.push_back(1); array.push_back(1); int k = 2;... 阅读全文
摘要:
class Solution { public: int jumpFloorII(int number) { if (number == 1) { return 1; } else if (number == 2) { return 2; ... 阅读全文
摘要:
class Solution { public: int jumpFloor(int number) { // if (number == 1) { return 1; } else if (number == 2) { return... 阅读全文
摘要:
/** * struct ListNode { * int val; * struct ListNode *next; * ListNode(int x) : * val(x), next(NULL) { * } * }; */ class Solution { public: vector print... 阅读全文
摘要:
class Solution { public: ListNode* EntryNodeOfLoop(ListNode* pHead) { vector vec; ListNode* list = NULL; if (pHead == NULL) return NULL; int flag = 0; ... 阅读全文
摘要:
递归版本: 阅读全文
摘要:
class Solution { public: ListNode* deleteDuplication(ListNode* pHead) { if (pHead == NULL) return pHead; if (pHead->next == NULL) return pHead; int First = pHe... 阅读全文