- 博客(17)
- 收藏
- 关注
原创 8.3吝啬SAT问题
吝啬SAT问题是这样的:给定一组子句(每个子句都是其中文字的析取)和整数k,求一个最多有k个变量为true的满足赋值——如果该赋值存在。证明吝啬问题是NP-完全问题。
2017-07-09 13:48:02 274
原创 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. 设立一个len行len列的dp数组~dp[i][j]表示字符串i~j下标所构成的子串中最长回文子串的长度。最后我们需要返回的是dp[
2017-06-22 16:54:43 106
原创 526. Beautiful Arrangement
题目描述: Suppose you have N integers from 1 to N. We define a beautiful arrangement as an array that is constructed by these N numbers successfully if one of the following is true for the ith position (1
2017-06-11 15:11:01 126
原创 523. Continuous Subarray Sum
题目描述: Given a list of non-negative numbers and a target integer k, write a function to check if the array has a continuous subarray of size at least 2 that sums up to the multiple of k, that is, sums
2017-06-04 22:54:10 137
原创 303. Range Sum Query - Immutable
题目描述: Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive. Note: You may assume that the array does not change.There are many calls to
2017-05-31 00:37:11 190
原创 26. Remove Duplicates from Sorted Array
题目描述: Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length. Do not allocate extra space for another array, you must do this in
2017-05-14 22:45:22 111
原创 40. Combination Sum II
题目描述: Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. Each number in C may only be used once in
2017-05-07 23:29:42 111
原创 39. Combination Sum
题目描述: Given a set of candidate numbers (C) (without duplicates) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. The same repeated number may
2017-04-30 18:05:45 109
原创 33. Search in Rotated Sorted Array
题目描述: Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2). You are given a target value to search
2017-04-22 22:01:44 152
原创 43. Multiply Strings
题目要求: Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2. Note: The length of both num1 and num2 is Both num1 and num2 contains
2017-04-15 13:49:47 142
原创 337. House Robber III
题目描述: he thief has found himself a new place for his thievery again. There is only one entrance to this area, called the "root." Besides the root, each house has one and only one parent house. Af
2017-04-08 23:21:43 141
原创 473. Matchsticks to Square
题目描述: Remember the story of Little Match Girl? By now, you know exactly what matchsticks the little match girl has, please find out a way you can make one square by using up all those matchsticks
2017-04-01 21:52:39 144
原创 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-03-25 19:52:18 119
原创 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-03-18 02:16:03 165
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人