5 小堃哥

尚未进行身份认证

暂无相关描述

等级
TA的排名 5k+

leetcode26+Remove Duplicates from Sorted Array

https://leetcode.com/problems/remove-duplicates-from-sorted-array/classSolution{public:intremoveDuplicates(vector<int>&nums){if(nums.size()<1)return0;int...

2019-08-22 00:02:57

leetcode24+Swap Nodes in Pairs

https://leetcode.com/problems/swap-nodes-in-pairs/structListNode{intval;ListNode*next;ListNode(intx):val(x),next(NULL){}};classSolution{public:ListNode*swapPairs(...

2019-08-21 19:12:36

leetcode23+Merge k Sorted Lists

https://leetcode.com/problems/merge-k-sorted-lists/structListNode{intval;ListNode*next;ListNode(intx):val(x),next(NULL){}};classSolution{public:ListNode*mergeTwo...

2019-08-21 11:46:21

leetcode22+Generate Parentheses

https://leetcode.com/problems/generate-parentheses/classSolution{public:voidgenerate(intleft,intright,stringstr,vector<string>&res){if(left==0&&right...

2019-08-21 00:18:26

leetcode21+Merge Two Sorted Lists

https://leetcode.com/problems/merge-two-sorted-lists/structListNode{intval;ListNode*next;ListNode(intx):val(x),next(NULL){}};classSolution{public:ListNode*mergeT...

2019-08-20 21:57:59

leetcode20+Valid Parentheses

https://leetcode.com/problems/valid-parentheses/classSolution{public:boolisValid(strings){stack<char>st;if(s.size()==0)returntrue;for(inti=0;i<s.s...

2019-08-20 21:16:40

leetcode306+翻转链表

https://leetcode.com/problems/reverse-linked-list/structListNode{intval;ListNode*next;ListNode(intx):val(x),next(NULL){}};classSolution{public:ListNode*reverseLi...

2019-08-20 21:00:51

leetcode18+4sum

https://leetcode.com/problems/4sum/classSolution{public:vector<vector<int>>fourSum(vector<int>&nums,inttarget){vector<vector<int>>res;...

2019-08-19 22:17:23

leetcode19+Remove Nth Node From End of List

https://leetcode.com/problems/remove-nth-node-from-end-of-list/structListNode{intval;ListNode*next;ListNode(intx):val(x),next(NULL){}};classSolution{public:ListNo...

2019-08-19 22:15:58

leetcode16+双指针

https://leetcode.com/problems/3sum-closest/classSolution{public:intthreeSumClosest(vector<int>&nums,inttarget){intMin=INT_MAX;sort(nums.begin(),nums.end()...

2019-08-19 00:37:31

leetcode15+three sum

https://leetcode.com/problems/3sum/classSolution{public:vector<vector<int>>threeSum(vector<int>&nums){vector<vector<int>>res;sort(nums...

2019-08-18 23:15:06

leetcode236+最近公共祖先

https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree/structTreeNode{intval;TreeNode*left;TreeNode*right;TreeNode(intx):val(x),left(NULL),right(NULL){...

2019-08-18 11:01:25

leetcode31+下一个排列

https://leetcode.com/problems/next-permutation/classSolution{public:voidnextPermutation(vector<int>&nums){intn=nums.size();if(n==1)return;for(inti...

2019-08-17 17:21:42

leetcode11+双指针

https://leetcode.com/problems/container-with-most-water/classSolution{public:intmaxArea(vector<int>&height){intstart=0,end=height.size()-1,contain=0;int...

2019-08-14 19:36:28

LeetCode46+全排列

https://leetcode.com/problems/permutations/classSolution{public:voidpermuteDFS(vector<int>&nums,intlevel,vector<int>&visited,vector<int>&out,vector<v...

2019-08-06 21:40:47

leetcode3+头条三面面试题

https://leetcode.com/problems/longest-substring-without-repeating-characters/classSolution{public:intlengthOfLongestSubstring(strings){intnum=0,i=0,j=0,index=0,len=0;...

2019-08-06 21:39:04

LC+add_two-numbers

https://leetcode.com/problems/add-two-numbers/structListNode{intval;ListNode*next;ListNode(intx):val(x),next(NULL){}};classSolution{public:ListNode*addTwoNumbers...

2019-08-04 00:33:41

LC+TwoSum

https://leetcode.com/problems/two-sum/classSolution{//经典hash处理public:vector<int>twoSum(vector<int>&nums,inttarget){vector<int>res;map<int,...

2019-08-04 00:32:41

leetcode951+判断两个二叉树是否是镜像对称来的,递归

https://leetcode.com/problems/flip-equivalent-binary-trees//***Definitionforabinarytreenode.*structTreeNode{*intval;*TreeNode*left;*TreeNode*right;*TreeN...

2019-06-26 20:22:01

leetcode1014+最大的区间和,前缀后缀使用

https://leetcode.com/problems/best-sightseeing-pair///题目要求求出A[i]+A[j]+i-j最大值,这个表达式可以等价变为(A[i]+i)+(A[j]-j),//对于A中每一个元素来说,都对应着两个值,分别是A[i]+i和A[i]-i。本题的解法可以抽象成把A分成两部分,//第一部分找出使得A[i]+i能得...

2019-06-14 10:01:38

查看更多

勋章 我的勋章
  • GitHub
    GitHub
    绑定GitHub第三方账户获取
  • 持之以恒
    持之以恒
    授予每个自然月内发布4篇或4篇以上原创或翻译IT博文的用户。不积跬步无以至千里,不积小流无以成江海,程序人生的精彩需要坚持不懈地积累!
  • 勤写标兵Lv1
    勤写标兵Lv1
    授予每个自然周发布1篇到3篇原创IT博文的用户。本勋章将于次周周三上午根据用户上周的博文发布情况由系统自动颁发。