- 博客(26)
- 收藏
- 关注
原创 课后练习8.3证明
题目描述:8.3 STINGY 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 variables are true, if su
2017-06-12 00:47:11 230
原创 算法课第18周第1题——55. Jump Game
题目描述:Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.
2017-06-25 22:18:27 255
原创 算法课第17周第1题——133. Clone Graph
题目描述:Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors.OJ's undirected graph serialization:Nodes are labeled uniquely.We use # as a separat
2017-06-18 20:43:16 239
原创 算法课第16周第1题—— 215. Kth Largest Element in an Array
题目描述:Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element.For example,Given [3,2,1,5,6,4] and k = 2,
2017-06-11 22:56:16 479
原创 算法课第15周第1题—— 416. Partition Equal Subset Sum
题目描述:Given a non-empty array containing only positive integers, find if the array can be partitioned into two subsets such that the sum of elements in both subsets is equal.Note:Each o
2017-06-04 20:59:14 229
原创 算法课第14周第1题——322. Coin Change
题目描述:You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that you need to make up that amount. If that amoun
2017-05-28 21:24:50 206
原创 算法课第13周第1题——486. Predict the Winner
题目描述:Given an array of scores that are non-negative integers. Player 1 picks one of the numbers from either end of the array followed by the player 2 and then player 1 and so on. Each time a pla
2017-05-21 17:03:38 310
原创 算法课第12周第2题——63. Unique Paths II
题目描述:Follow up for "Unique Paths":Now consider if some obstacles are added to the grids. How many unique paths would there be?An obstacle and empty space is marked as 1 and 0 respectivel
2017-05-14 22:03:54 207
原创 算法课第12周第1题——62. Unique Paths
题目描述:A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below).The robot can only move either down or right at any point in time. The robot is trying to
2017-05-14 21:26:11 193
原创 算法课第11周第1题——120. Triangle
题目描述:Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the following triangle[ [2],
2017-05-07 20:31:16 266
原创 算法课第10周第3题——91. Decode Ways
题目描述:A message containing letters from A-Z is being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an encoded message containing digits, determine t
2017-04-30 01:30:58 218
原创 算法课第10周第2题——53. Maximum Subarray
题目描述:Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [-2,1,-3,4,-1,2,1,-5,4],the contiguous subarray [4
2017-04-30 00:59:23 234
原创 算法课第10周第1题——70. Climbing Stairs
题目描述:You are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?Note: Given n wil
2017-04-26 16:02:03 233
原创 算法课第9周第1题——474. Ones and Zeroes
题目描述:In the computer world, use restricted resource you have to generate maximum benefit is what we always want to pursue.For now, suppose you are a dominator of m 0s and n 1s respectively.
2017-04-23 17:17:04 277
原创 算法课第8周第1题——494. Target Sum
题目描述:You are given a list of non-negative integers, a1, a2, ..., an, and a target, S. Now you have 2 symbols + and -. For each integer, you should choose one from + and - as its new symbol.
2017-04-16 20:59:52 240
原创 算法课第7周第1题——516. Longest Palindromic Subsequence
题目描述:Given a string s, find the longest palindromic subsequence's length in s. You may assume that the maximum length of s is 1000.Example 1:Input:"bbbab"Output:4One possible lon
2017-04-09 17:18:18 174
原创 算法课第6周第1题——402. Remove K Digits
题目描述:Given a non-negative integer num represented as a string, remove k digits from the number so that the new number is the smallest possible.Note:The length of num is less than 10002
2017-04-02 21:47:18 288
原创 算法课第5周第1题——452. Minimum Number of Arrows to Burst Balloons
题目描述:There are a number of spherical balloons spread in two-dimensional space. For each balloon, provided input is the start and end coordinates of the horizontal diameter. Since it's horizontal
2017-03-26 18:37:37 237
原创 算法课第4周第1题——417. Pacific Atlantic Water Flow
题目描述:Given an m x n matrix of non-negative integers representing the height of each unit cell in a continent, the "Pacific ocean" touches the left and top edges of the matrix and the "Atlantic
2017-03-19 21:30:59 286
原创 算法课第3周第2题——207. Course Schedule
题目描述:There are a total of n courses you have to take, labeled from 0 to n - 1.Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is ex
2017-03-12 03:56:23 350
原创 算法课第3周第1题——113. Path Sum II
题目描述:Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.For example:Given the below binary tree and sum = 22, 5
2017-03-11 15:46:12 301
原创 算法课第2周第2题——241. Different Ways to Add Parentheses
题目描述:Given a string of numbers and operators, return all possible results from computing all the different possible ways to group numbers and operators. The valid operators are +, - and *.Ex
2017-03-04 16:24:31 217
原创 算法课第2周第1题——100. Same Tree
题目描述:Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identical and the nodes have the same value.
2017-02-28 01:05:06 248
原创 算法课第1周第3题——38. Count and Say
题目描述:The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1 is read off as "one 1" or 11.11 is read off as "two 1s" or 21.21 is r
2017-02-27 04:36:00 318
原创 算法课第1周第2题——10. Regular Expression Matching
题目描述:Implement regular expression matching with support for '.' and '*'.'.' Matches any single character.'*' Matches zero or more of the preceding element.The matching should cover the enti
2017-02-27 03:45:09 218
原创 算法课第1周第1题——20. Valid Parentheses
题目描述:Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.The brackets must close in the correct order, "()" and "()[]{}" a
2017-02-24 23:36:46 253
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人