上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 36 下一页
摘要: 1 class Solution { 2 public: 3 void getP(vector > &result, vector &num, vector current, vector rec) { 4 if (num.size() == current.size())... 阅读全文
posted @ 2015-03-22 14:57 keepshuatishuati 阅读(125) 评论(0) 推荐(0) 编辑
摘要: Classical problem: 1 class Solution { 2 public: 3 void getP(vector > &result, vector &num, vector current, vector rec) { 4 if (current.siz... 阅读全文
posted @ 2015-03-22 14:52 keepshuatishuati 阅读(136) 评论(0) 推荐(0) 编辑
摘要: Follow the hint fromhttps://leetcode.com/discuss/24478/i-did-it-in-10-lines-of-c1. The last three digits of binary format will be :A 001C 011G 111T... 阅读全文
posted @ 2015-03-22 11:03 keepshuatishuati 阅读(113) 评论(0) 推荐(0) 编辑
摘要: Notes:1. Make a array to check whether they have same number of chars (s1[i] - 'a') and (s2[i] - 'a')2. When finally check, the i start from 1.3. It i... 阅读全文
posted @ 2015-03-22 10:48 keepshuatishuati 阅读(173) 评论(0) 推荐(0) 编辑
摘要: Same with I 1 /** 2 * Definition for binary tree 3 * struct TreeNode { 4 * int val; 5 * TreeNode *left; 6 * TreeNode *right; 7 * ... 阅读全文
posted @ 2015-03-21 17:27 keepshuatishuati 阅读(104) 评论(0) 推荐(0) 编辑
摘要: Recursive. 1 /** 2 * Definition for binary tree 3 * struct TreeNode { 4 * int val; 5 * TreeNode *left; 6 * TreeNode *right; 7 * ... 阅读全文
posted @ 2015-03-21 17:23 keepshuatishuati 阅读(122) 评论(0) 推荐(0) 编辑
摘要: Exact same as I. 1 class Solution { 2 public: 3 vector getRow(int rowIndex) { 4 if (rowIndex (); 5 vector result(1, 1); 6 ... 阅读全文
posted @ 2015-03-21 17:19 keepshuatishuati 阅读(99) 评论(0) 推荐(0) 编辑
摘要: This is simple. Just everything use current[j] += current[j-1]. But leave the first one to be "1". Then add another "1" to end. 1 class Solution { 2 p... 阅读全文
posted @ 2015-03-21 17:16 keepshuatishuati 阅读(115) 评论(0) 推荐(0) 编辑
摘要: I am lazy so I did not clear the two dynamic allowcated . 1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int val; 5 * ... 阅读全文
posted @ 2015-03-21 17:12 keepshuatishuati 阅读(141) 评论(0) 推荐(0) 编辑
摘要: Notes:1. If len dp(len+1, 0); 7 vector > rec(len, vector(len, false)); 8 for (int i = 0; i = 0; i--) {10 for (int j = i; ... 阅读全文
posted @ 2015-03-21 16:45 keepshuatishuati 阅读(118) 评论(0) 推荐(0) 编辑
上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 36 下一页