算法作业
盘龙流云佩
这个作者很懒,什么都没留下…
展开
-
Longest Substring Without Repeating Characters
字符串的最长子串原创 2017-02-23 23:54:41 · 179 阅读 · 0 评论 -
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 · 133 阅读 · 0 评论 -
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 · 133 阅读 · 0 评论 -
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 · 150 阅读 · 0 评论 -
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 · 218 阅读 · 0 评论 -
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 · 119 阅读 · 0 评论 -
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 · 119 阅读 · 0 评论 -
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 · 159 阅读 · 0 评论 -
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 · 151 阅读 · 0 评论 -
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 · 121 阅读 · 0 评论 -
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 · 151 阅读 · 0 评论 -
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 · 131 阅读 · 0 评论 -
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 · 151 阅读 · 0 评论 -
240.Search a 2D Matrix II
搜索矩阵中的数。原创 2017-03-11 15:01:51 · 111 阅读 · 0 评论 -
Median of Two Sorted Arrays
问题描述:两个有序数组的中位数原创 2017-03-04 21:48:01 · 137 阅读 · 0 评论 -
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 · 175 阅读 · 0 评论 -
8.3吝啬SAT问题
吝啬SAT问题是这样的:给定一组子句(每个子句都是其中文字的析取)和整数k,求一个最多有k个变量为true的满足赋值——如果该赋值存在。证明吝啬问题是NP-完全问题。原创 2017-07-09 13:48:02 · 305 阅读 · 0 评论