LeetCode
文章平均质量分 55
t617
放码过来
展开
-
LeetCode题目分类
Leetcode原创 2022-08-13 17:48:59 · 259 阅读 · 1 评论 -
算法概论8.16
考虑怎么把一个3SAT实例转化成一个EXPERIMENTAL CUISINE 问题。 对于任意一个3SAT问题。若其某一子句cc为(U∪V∪W)(U∪V∪W)我们可以相应地建立7种ingredients,分别为: {UV¯¯¯Wc¯¯¯¯¯,U¯¯¯VWc¯¯¯¯¯,U¯¯¯V¯¯¯Wc,UVW¯¯¯¯,U¯¯¯VWc,UV¯¯¯Wc,UVWcU\overline{V}\overline{W_c原创 2018-01-01 16:54:53 · 332 阅读 · 0 评论 -
455. Assign Cookies
455. Assign Cookies题目 Assume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie. Each child i has a greed factor gi, which is th原创 2018-01-01 13:54:56 · 279 阅读 · 0 评论 -
474. Ones and Zeroes
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 respecti原创 2017-12-06 13:58:30 · 270 阅读 · 0 评论 -
322. Coin Change
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 am原创 2017-12-12 20:41:32 · 270 阅读 · 0 评论 -
53. Maximum Subarray
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 con原创 2017-11-15 20:41:47 · 223 阅读 · 0 评论 -
198. House Robber
198. House Robber题目描述 You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them原创 2017-11-03 12:22:11 · 281 阅读 · 0 评论 -
Queue Reconstruction by Height
406. Queue Reconstruction by Height题目描述 Suppose you have a random list of people standing in a queue. Each person is described by a pair of integers (h, k), where h is the height of the person and k原创 2017-10-17 12:59:23 · 251 阅读 · 0 评论 -
55. Jump Game
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 t原创 2017-09-09 15:09:12 · 282 阅读 · 0 评论 -
240. Search a 2D Matrix II
240. Search a 2D Matrix II题目描述Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:Integers in each row are sorted in asc原创 2017-09-09 14:13:41 · 294 阅读 · 0 评论 -
53. Maximum Subarray
Maximum SubarrayFind 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 su原创 2017-09-09 12:05:06 · 277 阅读 · 0 评论 -
167. Two Sum II - Input array is sorted
167. Two Sum II - Input array is sortedTwo Sum II - Input array is sorted题目描述解题思路题目描述 Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to原创 2017-09-17 11:42:48 · 332 阅读 · 0 评论 -
98. Validate Binary Search Tree
98. Validate Binary Search Tree题目描述 Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows: The left subtree of a node contains only n原创 2017-09-23 17:31:05 · 322 阅读 · 0 评论