摘要: 1 class Solution { 2 public: 3 int lengthOfLongestSubstring(string s) { 4 vector signs(256, -1); 5 int max_length = 0; 6 int last_valid = -1; 7 for (size_t ... 阅读全文
posted @ 2016-09-06 22:19 nosaferyao 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int val; 5 * ListNode *next; 6 * ListNode(int x) : val(x), next(NULL) {} 7 * }; 8 */ 9 10 void ad... 阅读全文
posted @ 2016-09-06 21:29 nosaferyao 阅读(166) 评论(0) 推荐(0) 编辑
摘要: 今天先熟悉熟悉, 希望后面能一次就过 1 #include 2 #include 3 4 using namespace std; 5 6 bool mycompare(const pair&a, const pair& b) 7 { 8 return a.first twoSum(vector& nums, int target) { 14 v... 阅读全文
posted @ 2016-09-06 20:31 nosaferyao 阅读(155) 评论(0) 推荐(0) 编辑