题目:
Given a list of non negative integers, arrange them such that they form the largest number.
For example, given [3, 30, 34, 5, 9], the largest formed number is 9534330.
Note: The result...
分类:
编程语言 时间:
2015-01-28 13:08:57
阅读次数:
245
Given a list of non negative integers, arrange them such that they form the largest number.
For example, given [3, 30, 34, 5, 9], the largest formed number is 9534330.
Note: The result may be ve...
分类:
其他好文 时间:
2015-01-28 11:10:29
阅读次数:
148
【题目】
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,...
分类:
其他好文 时间:
2015-01-27 21:59:43
阅读次数:
145
Problem:Given a list of non negative integers, arrange them such that they form the largest number.For example, given[3, 30, 34, 5, 9], the largest fo...
分类:
其他好文 时间:
2015-01-27 21:51:15
阅读次数:
147
DescriptionThere is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a...
分类:
其他好文 时间:
2015-01-27 21:43:01
阅读次数:
170
Largest palindrome product
Problem 4
A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99.
Find the largest p...
分类:
编程语言 时间:
2015-01-27 09:34:40
阅读次数:
223
Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area.
动态规划
用left[ ]数组纪录该点距离最左边(在矩形内部)的1的距离,用right[ ]数组纪录该点距离最右边(在矩形内部)的1距离,height[ ]...
分类:
其他好文 时间:
2015-01-27 09:32:51
阅读次数:
131
Problem 3
The prime factors of 13195 are 5, 7, 13 and 29.
What is the largest prime factor of the number 600851475143 ?
python code:
import math
sqrt=math.sqrt
def func(x):
...
分类:
编程语言 时间:
2015-01-26 21:07:23
阅读次数:
216
问题描述:
Find the contiguous subarray within an array (containing at least one number) which has the largest product.
For example, given the array [2,3,-2,4],
the contiguous subarray [2,3] has the l...
分类:
其他好文 时间:
2015-01-26 19:18:05
阅读次数:
145
原题地址先将数字转成字符串,然后排序,让能够组成更大数字的字符串放在前面,最后拼接成完整的字符串即可。有种很巧妙的方法判断两个字符串的大小关系,假设两个字符串是A,B,则比较AB和BA,若AB比BA大,说明A应该放在前面,即A &num) { 2 string res; 3 4 vecto...
分类:
其他好文 时间:
2015-01-26 19:00:19
阅读次数:
129