随笔分类 -  h:Lintcode

摘要:C++,time: O(n^2)space: O(0)class Solution {public: /** * @param str: a string * @return: a boolean */ bool isUnique(string &str) { ... 阅读全文
posted @ 2015-11-27 09:54 ZH奶酪 阅读(252) 评论(0) 推荐(0)
摘要:C++,time: O(n)space:O(n) 1 class Solution { 2 public: 3 /** 4 * @param str: a string 5 * @param offset: an integer 6 * @return: not... 阅读全文
posted @ 2015-11-27 09:31 ZH奶酪 阅读(293) 评论(0) 推荐(0)
摘要:C++ 1 class Solution { 2 public: 3 /** 4 * @param dictionary: a vector of strings 5 * @return: a vector of strings 6 */ 7 vecto... 阅读全文
posted @ 2015-11-27 01:12 ZH奶酪 阅读(301) 评论(0) 推荐(0)
摘要:C++ 1 class Solution { 2 public: 3 /** 4 * @param A: A string includes Upper Case letters 5 * @param B: A string includes Upper Case let... 阅读全文
posted @ 2015-11-27 00:57 ZH奶酪 阅读(222) 评论(0) 推荐(0)
摘要:C++ 1 class Solution { 2 public: 3 /** 4 * @param n: An integer 5 * @return: An integer 6 */ 7 int climbStairs(int n) { 8 ... 阅读全文
posted @ 2015-11-27 00:45 ZH奶酪 阅读(257) 评论(0) 推荐(0)
摘要:C++,递归 1 /** 2 * Definition of TreeNode: 3 * class TreeNode { 4 * public: 5 * int val; 6 * TreeNode *left, *right; 7 * TreeNode(int ... 阅读全文
posted @ 2015-11-27 00:24 ZH奶酪 阅读(267) 评论(0) 推荐(0)
摘要:C++,递归 1 /** 2 * Definition of TreeNode: 3 * class TreeNode { 4 * public: 5 * int val; 6 * TreeNode *left, *right; 7 * TreeNode(int ... 阅读全文
posted @ 2015-11-26 22:34 ZH奶酪 阅读(334) 评论(0) 推荐(0)
摘要:C++,递归,辅助函数 1 /** 2 * Definition of TreeNode: 3 * class TreeNode { 4 * public: 5 * int val; 6 * TreeNode *left, *right; 7 * TreeNode... 阅读全文
posted @ 2015-11-26 21:37 ZH奶酪 阅读(221) 评论(0) 推荐(0)
摘要:C++ 1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int val; 5 * ListNode *next; 6 * ListNode(int x) : val(x),... 阅读全文
posted @ 2015-11-26 20:15 ZH奶酪 阅读(237) 评论(0) 推荐(0)
摘要:C++ 1 class Solution { 2 public: 3 /** 4 * @param a a number 5 * @param b a number 6 * @return the result 7 */ 8 string ad... 阅读全文
posted @ 2015-11-26 20:00 ZH奶酪 阅读(263) 评论(0) 推荐(0)
摘要:C++ 1 class Solution { 2 public: 3 /* 4 * @param a: The first integer 5 * @param b: The second integer 6 * @return: The sum of a an... 阅读全文
posted @ 2015-11-26 19:33 ZH奶酪 阅读(192) 评论(0) 推荐(0)
摘要:C++ 1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int val; 5 * ListNode *next; 6 * ListNode(int x) : val(x),... 阅读全文
posted @ 2015-11-26 19:27 ZH奶酪 阅读(259) 评论(0) 推荐(0)
摘要:C++ 1 class Solution{ 2 public: 3 /** 4 * @param n: an integer 5 * @return an integer f(n) 6 */ 7 int fibonacci(int n) { 8 ... 阅读全文
posted @ 2015-11-26 19:19 ZH奶酪 阅读(254) 评论(0) 推荐(0)
摘要:帐号:cheesezh 阅读全文
posted @ 2015-11-26 19:14 ZH奶酪 阅读(197) 评论(0) 推荐(0)