原创 8.3吝嗇SAT問題
吝嗇SAT問題是這樣的:給定一組子句(每個子句都是其中文字的析取)和整數k,求一個最多有k個變量爲true的滿足賦值——如果該賦值存在。證明吝嗇問題是NP-完全問題。 已知SAT是NP完全問題,因此,只要能把SAT歸約到吝嗇SAT問題,即
原创 Maximum Subarray
題目描述: Find the contiguous subarray within an array (containing at least one number) which has the lar
原创 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 contin
原创 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: Y
原创 516. Longest Palindromic Subsequence
題目描述: Given a string s, find the longest palindromic subsequence’s length in s. You may assume that the maximum length
原创 526. Beautiful Arrangement
題目描述: Suppose you have N integers from 1 to N. We define a beautiful arrangement as an array that is constructed by th
原创 Kth Largest Element in an Array
題目描述: Find the kth largest element in an unsorted array. Note that it is the kth largest element in t
原创 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
原创 39. Combination Sum
題目描述: Given a set of candidate numbers (C) (without duplicates) and a target number (T), find all unique combination
原创 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
原创 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 proper
原创 40. Combination Sum II
題目描述: Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where t
原创 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
原创 43. Multiply Strings
題目要求: Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2. Not
原创 33. Search in Rotated Sorted Array
題目描述: Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.