![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
习题
pkmifeng
这个作者很懒,什么都没留下…
展开
-
欢迎使用CSDN-markdown编辑器
Two Sum原创 2017-02-26 22:28:37 · 127 阅读 · 0 评论 -
最大和
最大和description从数列A[0], A[1], A[2], …, A[N-1]中选若干个数,要求相邻的数不能都选,也就是说如果选了A[i], 就不能选A[i-1]和A[i+1]. 求能选出的最大和.1 <= N <= 100000, 1 <= A[i] <= 1000请为下面的Solution类实现解决上述问题的函数maxSum,函数参数A是给出的数列,返回值为所求的最大和转载 2017-06-24 19:30:27 · 175 阅读 · 0 评论 -
Valid Perfect Square
Valid Perfect SquaredescriptionGiven a positive integer num, write a function which returns True if num is a perfect square else False.Note: Do not use any built-in library function such as sqrt()....转载 2017-06-11 16:02:12 · 161 阅读 · 0 评论 -
Guess Number Higher or Lower
Guess Number Higher or LowerdescriptionWe are playing the Guess Game. The game is as follows:I pick a number from 1 to n. You have to guess which number I picked.Every time you guess wrong....转载 2017-06-11 15:57:54 · 196 阅读 · 0 评论 -
Is Subsequence
Is SubsequencedescriptionGiven a string s and a string t, check if s is subsequence of t.You may assume that there is only lower case English letters in both s and t. t is potentially a very long ....转载 2017-06-11 15:52:00 · 183 阅读 · 0 评论 -
Arranging Coins
Arranging CoinsdescriptionYou have a total of n coins that you want to form in a staircase shape, where every k-th row must have exactly k coins.转载 2017-06-11 15:47:14 · 193 阅读 · 0 评论 -
Excel Sheet Column Number
Excel Sheet Column NumberdescriptionRelated to question Excel Sheet Column TitleGiven a column title as appear in an Excel sheet, return its corresponding column number.转载 2017-05-20 13:32:02 · 170 阅读 · 0 评论 -
pow(x, n)
pow(x, n)descriptionImplement pow(x, n).转载 2017-05-20 13:27:02 · 173 阅读 · 0 评论 -
Roman to Integer
Roman to Integerdescription Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999.转载 2017-05-20 13:20:06 · 102 阅读 · 0 评论 -
Remove K Digits
Remove K Digitsproblem: Given a non-negative integer num represented as a string, remove k digits from the number so that the new number is the smallest possible.转载 2017-04-24 20:59:32 · 250 阅读 · 0 评论 -
Decode String
Decode Stringproblem:Given an encoded string, return it’s decoded string.The encoding rule is: k[encoded_string], where the encoded_string inside the square brackets is being repeated exactly k times.转载 2017-04-24 20:43:20 · 315 阅读 · 0 评论 -
Next Greater Element I
Next Greater Element Iproblem:You are given two arrays (without duplicates) nums1 and nums2 where nums1’s elements are subset of nums2. Find all the next greater numbers for nums1’s elements in the .......转载 2017-04-24 20:34:02 · 222 阅读 · 0 评论 -
Kth Largest Element in an Array
description: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.转载 2017-04-08 15:29:06 · 149 阅读 · 0 评论 -
Search a 2D Matrix II
description: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 ascending from left to right.....转载 2017-04-08 15:17:11 · 175 阅读 · 0 评论 -
Different Ways to Add Parentheses
description:Given a string of numbers and operators, return all possible results from computing all the different possible ways to group numbers and operators. The valid operators are +, - and *.原创 2017-04-08 15:04:42 · 152 阅读 · 0 评论 -
文章标题
Majority Elementdescription: Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.原创 2017-03-12 12:51:39 · 175 阅读 · 0 评论 -
Maximum Subarray
Maximum Subarraydescription: Find the contiguous subarray within an array (containing at least one number) which has the largest sum.原创 2017-03-19 19:45:00 · 176 阅读 · 0 评论 -
#Roman to Integer
Roman to Integer:Given a roman numeral, convert it to an integer.原创 2017-03-05 19:25:43 · 136 阅读 · 0 评论 -
第八章课后作业
Chapter 8 NP-complete problems8.10descriptionProving NP-completeness by generalization. For each of the problems below, prove that it is NP-complete by showing that it is a generalization of some ....原创 2017-06-24 19:45:26 · 376 阅读 · 0 评论