
leetcode
文章平均质量分 77
nianhuatingyu
这个作者很懒,什么都没留下…
展开
-
leetcode--4Sum
Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target. Note: The solution原创 2016-09-09 09:50:54 · 212 阅读 · 0 评论 -
leetcode-- Container With Most Water
Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Fin原创 2016-09-09 10:35:21 · 209 阅读 · 0 评论 -
leetcode--Longest Common Prefix
Write a function to find the longest common prefix string amongst an array of strings. Subscribe to see which companies asked this question 解法: /********************************************原创 2016-09-09 13:40:32 · 223 阅读 · 0 评论 -
Generate Parentheses--letcode
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set is: [ "((()))", "(()())", "(())()", "()(())原创 2016-09-15 18:06:08 · 192 阅读 · 0 评论 -
Reverse Nodes in k-Group --leetcode
#include #include #include #include using namespace std; struct ListNode { int val; ListNode *next; ListNode(int x) : val(x), next(NULL) {} }; class Solution { public: ListNode* revers原创 2016-09-15 23:48:28 · 326 阅读 · 0 评论 -
Leetcode--3Sum
Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero. Note: The solution set must not contain原创 2016-09-07 22:16:46 · 226 阅读 · 0 评论