2013年3月7日

[leetcode] Add Two Numbers *

摘要: 1 /* 2 * Easy 3 * 4 * @author: HZT 5 * @date: 2013-3-7 6 */ 7 8 #include <iostream> 9 using namespace std;10 11 struct ListNode{12 int val;13 ListNode *next;14 ListNode(int x) : val(x), next(NULL) {}15 };16 17 class Solution {18 public:19 ListNode *addTwoNumbers(ListNode *l1, ... 阅读全文

posted @ 2013-03-07 22:06 龙豆 阅读(345) 评论(0) 推荐(0) 编辑

[leetcode] Longest Substring Without Repeating Characters

摘要: 1 /* 2 * Use two points, pBeg and pEnd, pointing to the begin and end 3 * of current substring without repeating respectively. Integer 4 * Array pos[256] records the last occurrence position of each 5 * ASCII character. 6 * 7 * For each loop, pEnd moved forward one character. If the new... 阅读全文

posted @ 2013-03-07 21:22 龙豆 阅读(267) 评论(0) 推荐(0) 编辑

导航