会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
卖程序的小歪
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
40
41
42
43
44
45
46
下一页
2014年3月20日
LeetCode Word Search
摘要: typedef struct tagCharUsed { int i; int j; bool used; tagCharUsed(int _i, int _j, bool _used = false): i(_i), j(_j), used(_used){};} CharU...
阅读全文
posted @ 2014-03-20 15:23 卖程序的小歪
阅读(210)
评论(0)
推荐(0)
2014年3月19日
LeetCode Distinct Subsequences
摘要: Given a stringSand a stringT, count the number of distinct subsequences ofTinS.A subsequence of a string is a new string which is formed from the orig...
阅读全文
posted @ 2014-03-19 23:57 卖程序的小歪
阅读(172)
评论(0)
推荐(0)
LeetCode Binary Tree Postorder Traversal
摘要: /** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(...
阅读全文
posted @ 2014-03-19 01:23 卖程序的小歪
阅读(161)
评论(0)
推荐(0)
2014年3月18日
LeetCode Minimum Depth of Binary Tree
摘要: class Solution {public: int minDepth(TreeNode *root) { if (root == NULL) return 0; int min_depth = INT_MAX; dfs(root, 0, min_d...
阅读全文
posted @ 2014-03-18 16:15 卖程序的小歪
阅读(178)
评论(0)
推荐(0)
LeetCode Edit Distance
摘要: class Solution {public: int minDistance(string word1, string word2) { const int cols = word1.length() + 1; const int rows = word2.len...
阅读全文
posted @ 2014-03-18 15:36 卖程序的小歪
阅读(244)
评论(0)
推荐(0)
2014年3月17日
LeetCode CombinationSum II
摘要: class Solution {public: vector > combinationSum2(vector &num, int target) { sort(num.begin(), num.end()); vector > tmp; vector sel; dfs(num, 0, target, sel, tmp); return tmp; } void dfs(vector &num, int pos, int target, vector& sel, vector >& r...
阅读全文
posted @ 2014-03-17 21:10 卖程序的小歪
阅读(180)
评论(0)
推荐(0)
LeetCode CombinationSum
摘要: class Solution {public: vector > combinationSum(vector &candidates, int target) { sort(candidates.begin(), candidates.end()); candidates.erase(unique(candidates.begin(), candidates.end()), candidates.end()); vector > tmp; vector sel; dfs(...
阅读全文
posted @ 2014-03-17 19:54 卖程序的小歪
阅读(198)
评论(0)
推荐(0)
2014年3月15日
LeetCode Longest Substring Without Repeating Characters
摘要: class Solution {public: int lengthOfLongestSubstring(string s) { int len = s.length(); if (len mlen) mlen = clen; q++; ...
阅读全文
posted @ 2014-03-15 12:41 卖程序的小歪
阅读(159)
评论(0)
推荐(0)
LeetCode Reorder List
摘要: 1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int val; 5 * ListNode *next; 6 * ListNode(int x) : val(x), ne...
阅读全文
posted @ 2014-03-15 10:35 卖程序的小歪
阅读(177)
评论(0)
推荐(0)
2014年3月14日
LeetCode Copy List with Random Pointer
摘要: /** * Definition for singly-linked list with a random pointer. * struct RandomListNode { * int label; * RandomListNode *next, *random; * RandomListNode(int x) : label(x), next(NULL), random(NULL) {} * }; */class Solution {public: RandomListNode *copyRandomList(RandomListNode *head) { ...
阅读全文
posted @ 2014-03-14 21:10 卖程序的小歪
阅读(333)
评论(0)
推荐(0)
上一页
1
···
40
41
42
43
44
45
46
下一页
公告