
Leetcode
llwszjj
这个作者很懒,什么都没留下…
展开
-
LeetCode - Two Sum
Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two numbers such that they add up to the target, whe转载 2015-03-25 15:21:41 · 421 阅读 · 0 评论 -
LeetCode Next Permutation
1.Next Permutation 原文链接:点击这里进入 基本内容: 解题思想: 所谓一个排列的下一个排列的意思就是 这一个排列与下一个排列之间没有其他的排列。这就要求这一个排列与下一个排列有尽可能长的共同前缀,也即变化限制在尽可能短的后缀上。可能理解起来比较难懂。转载 2015-03-25 16:17:00 · 516 阅读 · 0 评论 -
LeetCode Longest Consecutive Sequence
Longest Consecutive SequenceGiven an unsorted array of integers, find the length of the longest consecutive elements sequence.For example,Given [100, 4, 200, 1, 3, 2],The longe转载 2015-03-25 15:14:08 · 412 阅读 · 0 评论 -
Clone Graph
c++dfs// LeetCode, Clone Graph// DFS,时间复杂度 O(n),空间复杂度 O(n)class Solution {public: UndirectedGraphNode *cloneGraph(const UndirectedGraphNode *node) { if(node == nullptr) return转载 2015-04-30 11:39:41 · 433 阅读 · 0 评论 -
Largest Rectangle in Histogram
Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the histogram.Above is a histogram where width of转载 2015-04-30 16:38:13 · 428 阅读 · 0 评论 -
Merge k Sorted Lists
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */class Solution {public: Li原创 2015-05-17 15:35:12 · 405 阅读 · 0 评论 -
leetcode难度分布
ID Question Diff Freq Data StructureAlgorithms 1T原创 2015-10-12 21:08:44 · 900 阅读 · 0 评论