题目描述Given a number sequence whose length is n, you
can delete at most k numbers in the sequence.After that you are asked to answer
the maximum length ...
分类:
其他好文 时间:
2014-05-19 22:21:32
阅读次数:
304
Given an unsorted integer array, find the first
missing positive integer.For example,Given [1,2,0] return 3,and [3,4,-1,1]
return 2.Your algorithm sho...
分类:
其他好文 时间:
2014-05-16 02:58:54
阅读次数:
249
【题目】
原文:
1.8 Assume you have a method isSubstring which checks if one word is a substring of another. Given two strings, s1 and s2, write code to check if s2 is a rotation of s1 using only one...
分类:
其他好文 时间:
2014-05-16 01:50:08
阅读次数:
311
【题目】
Given an integer, convert it to a roman numeral.
Input is guaranteed to be within the range from 1 to 3999.
【题意】
给定一个整数,将其表示成罗马数字
【思路】
罗马数字中只使用如下七个基值字母:M,D,C,L,X,V,I,分别用来表示1000、500、100、50、10、5、1。
罗马数组数规则:
基本数字Ⅰ、X 、C 中的任何一个,自身连用构成数目,或者放在大数的右边连用...
分类:
其他好文 时间:
2014-05-16 01:46:55
阅读次数:
312
题目1: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,...
分类:
其他好文 时间:
2014-05-16 01:46:15
阅读次数:
460
Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero....
分类:
其他好文 时间:
2014-05-16 01:34:36
阅读次数:
293
【题目】
Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Find two lines, which together with x-axis forms a contain...
分类:
其他好文 时间:
2014-05-16 01:32:47
阅读次数:
406
Problem DescriptionA number sequence is defined
as follows:f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7.Given
A, B, and n, you are t...
分类:
其他好文 时间:
2014-05-16 00:34:50
阅读次数:
354
A linked list is given such that each node
contains an additional random pointer which could point to any node in the list
or null.Return a deep copy ...
分类:
其他好文 时间:
2014-05-15 21:00:06
阅读次数:
325
Given two binary strings, return their sum
(also a binary string).For example, a = "11" b = "1" Return "100".string
的操作,短string补位。两个“0”会输出一个“00”,要特殊处理...
分类:
其他好文 时间:
2014-05-15 17:47:57
阅读次数:
283