- 博客(9)
- 收藏
- 关注
原创 文章标题
LeetCode - Trapping Rain Water问题描述https://leetcode.com/problems/trapping-rain-water/ 大意是给定一系列堆积方块,求当下雨的时候这些方块组成的凹槽能够容纳多少水。解答这道题是经同学推荐尝试的。最早我想到的是一个比较直接的O(n2)O(n^2)的算法:从左到右每列方块进行循环(外层循环),这个需要O(n)O(n)的时间
2016-12-24 10:17:16
411
原创 《Algorithms》NP-complete 部分证明习题解答
《Algorithms》NP-complete 部分证明习题解答8.3STINGY SAT is the following problem: given a set of clauses (each a disjunction of literals) and an integer k, find a satisfying assignment in which at most k variabl
2016-12-19 17:15:53
2144
原创 LeetCode - Best Time To Buy and Sell Stock Series (I, II, III, IV, with Cooldown)
LeetCode - Best Time to Buy and Sell Stock 系列 解题报告本文记录笔者在解LeetCode上的Best Time to Buy and Sell Stock系列时的一些想法。该系列题目共有五道,它们背景相似,但因为条件限制不同,解决思路也不太相同。I Best Time to Buy and Sell Stock https://leet
2016-10-23 18:08:26
589
原创 LeetCode 410 - Split Array Largest Sum
410. Split Array Largest Sum问题描述 Given an array which consists of non-negative integers and an integer m, you can split the array into m non-empty continuous subarrays. Write an algorithm to minimize
2016-10-20 22:29:46
518
原创 LeetCode 312 - Burst Balloons
LeetCode 312 - Burst Balloons题目 Given n balloons, indexed from 0 to n-1. Each balloon is painted with a number on it represented by array nums. You are asked to burst all the balloons. If the you bur
2016-09-11 17:19:16
542
原创 LeetCode 241 - Different Ways to Add Parentheses
LeetCode 241 - Different Ways to Add Parentheses LeetCode 241 - Different Ways to Add Parentheses Given a string of numbers and operators, return all possible results from computing all the differ
2016-09-09 00:51:18
364
原创 LeetCode 23 - Merge k Sorted Lists
LeetCode 23 - Merge k Sorted Lists LeetCode 23 - Merge k Sorted Lists Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.
2016-09-09 00:50:51
309
原创 LeetCode 2 - Add Two Numbers
问题简述 Add Two Numbers You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the tw
2016-09-06 19:33:45
309
原创 LeetCode 1 - Two Sum
问题简述 Two Sum Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution.
2016-09-06 19:23:40
264
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人