摘要: /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solu 阅读全文
posted @ 2020-01-02 22:12 chiwin 阅读(94) 评论(0) 推荐(0) 编辑
摘要: class Solution { public: string gethead(string str){//获取头单词 string ret = ""; int strlen = str.length(); for(int i = 0; i < strlen; ++i){ if(str[i] == 阅读全文
posted @ 2020-01-02 20:42 chiwin 阅读(255) 评论(0) 推荐(0) 编辑
摘要: C++: class Solution { public: int missingNumber(vector<int>& arr) { int subnum = abs(arr[1]-arr[0]) < abs(arr[2]-arr[1]) ? arr[1]-arr[0] : arr[2]-arr[ 阅读全文
posted @ 2020-01-02 17:38 chiwin 阅读(282) 评论(0) 推荐(0) 编辑