自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(17)
  • 收藏
  • 关注

原创 算法课后题

8.3首先 STINGY SAT的解是可在多项式时间内验证的,因此属于NP另外 将k设为所有变量的总个数即可将SAT归约到STINGY SAT,而SAT又是NP完全问题,所以STINGY SAT也是NP完全问题

2018-01-09 00:35:19 130

原创 688. Knight Probability in Chessboard

问题描述:On an NxN chessboard, a knight starts at the r-th row and c-th column and attempts to make exactly K moves. The rows and columns are 0 indexed, so the top-left square is (0, 0), and t

2017-12-31 14:57:14 191

原创 300. Longest Increasing Subsequence

问题描述:Given an unsorted array of integers, find the length of longest increasing subsequence.For example,Given [10, 9, 2, 5, 3, 7, 101, 18],The longest increasing subsequence is [2, 3, 7,

2017-12-24 21:18:13 106

原创 740. Delete and Earn

问题描述:Given an array nums of integers, you can perform operations on the array.In each operation, you pick any nums[i] and delete it to earn nums[i] points. After, you must delete every ele

2017-12-18 16:47:52 103

原创 698. Partition to K Equal Sum Subsets

问题描述:Given an array of integers nums and a positive integer k, find whether it's possible to divide this array into k non-empty subsets whose sums are all equal.给一个数组和一个正整数k,返回该数组是否可以分成k个子

2017-12-10 23:45:29 106

原创 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.给一个非空正整数数组,返回是否可以

2017-12-03 22:37:24 90

原创 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-11-27 00:32:51 90

原创 647. Palindromic Substrings

问题描述:Given a string, your task is to count how many palindromic substrings in this string.The substrings with different start indexes or end indexes are counted as different substrings even

2017-11-20 00:35:18 88

原创 712. Minimum ASCII Delete Sum for Two Strings

问题描述:Given two strings s1, s2, find the lowest ASCII sum of deleted characters to make two strings equal.给两个字符串,删除字符串的字符,直到两个字符串相同,算出减去的字符的ASC码的和的最小值问题解决:使用动态规划,找到递推式,用a[i][j]表示s1前i个,s2前j个

2017-11-11 22:51:16 102

原创 Maximum Length of Repeated Subarray

问题描述:Given two integer arrays A and B, return the maximum length of an subarray that appears in both arrays.给定两个数组A、B,返回两个数组中的最大相同子数组的长度问题解决:用二维数组a[i][j]储存通过动态规划找到A数组到i为止,B数组到j为止的最大相同字

2017-11-11 22:26:30 134

原创 121. Best Time to Buy and Sell Stock

问题描述:Say you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to complete at most one transaction (ie, buy one and sell one share of

2017-10-30 16:46:00 142

原创 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 the minimum

2017-10-22 20:07:11 105

原创 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 is the number of people in

2017-10-16 13:14:23 116

原创 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-10-09 16:32:49 123

原创 169. Majority Element

问题描述:Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.You may assume that the array is non-empty and the majori

2017-10-02 15:49:38 130

原创 Median of Two Sorted Arrays

问题描述:There are two sorted arrays nums1 and nums2 of size m and n respectively.Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).给两个长度分别为m、n的已

2017-09-23 14:40:00 152

原创 Two Sum

对LeetCode问题的解决方法的描述

2017-09-10 09:27:27 115

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除