- 博客(4)
- 收藏
- 关注
原创 [LeetCode 3] Longest Substring Without Repeating Characters
class Solution { public: int lengthOfLongestSubstring(string s) { vector<int> charIndex(256, -1); int longest = 0, m = 0; for (int i = 0; i < s.length(); i++) { m = max(char
2017-02-26 23:31:29 197
原创 [LeetCode 15] 3Sum
class Solution { public: vector<vector<int>> threeSum(vector<int>& nums) { sort(nums.begin(),nums.end()); vector<vector<int>> res; for(int i=0;i<nums.size();i++) {
2017-02-26 23:29:08 272
原创 [LeetCode 77] Combinations(精妙的迭代)
题目内容77.Combinations Given two integers n and k, return all possible combinations of k numbers out of 1 … n.For example, If n = 4 and k = 2, a solution is:[ [2,4], [3,4], [2,3], [1,2],
2017-02-08 23:25:16 374
原创 [LeetCode 199] Binary Tree Right Side View (递归的层数)
题目内容199 Binary Tree Right Side View Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom.For example: Given th
2017-02-08 22:51:12 214
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人