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...
分类:
其他好文 时间:
2015-04-21 23:59:29
阅读次数:
343
Roman to Integer
Given a roman numeral, convert it to an integer.
Input is guaranteed to be within the range from 1 to 3999.
解题思路:
罗马数字转化成数字。一种方法是映射法,每一位(阿拉伯数字)的字符到阿拉伯数字的映射。如下所示:
class Solu...
分类:
其他好文 时间:
2015-04-18 20:40:01
阅读次数:
167
Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.Analyse: Be cautious abou the expression of ...
分类:
其他好文 时间:
2015-04-18 20:25:54
阅读次数:
116
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...
分类:
其他好文 时间:
2015-04-18 20:23:36
阅读次数:
130
Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.首先,学习一下罗马数字,参考罗马数字罗马数字是最古老的数字表示方式,比阿拉伯数组早200...
分类:
其他好文 时间:
2015-04-18 20:21:32
阅读次数:
116
Integer to Roman
Given an integer, convert it to a roman numeral.
Input is guaranteed to be within the range from 1 to 3999.
解题思路:
数字转罗马字符。并不是非常复杂,罗马字符的表示如维基百科所述http://zh.wikipedia.org/wiki/...
分类:
其他好文 时间:
2015-04-18 19:15:08
阅读次数:
135
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 largest produ...
分类:
其他好文 时间:
2015-04-17 22:23:08
阅读次数:
170
1、什么是闭包呢?Whenever you see the function keyword within another function, the inner function has access to variables in the outer functionfunction foo(x...
分类:
编程语言 时间:
2015-04-17 17:13:19
阅读次数:
133
Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.class Solution {public: string intToRoman...
分类:
其他好文 时间:
2015-04-16 23:25:42
阅读次数:
117
Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.class Solution {public: int romanToInt(st...
分类:
其他好文 时间:
2015-04-16 23:22:05
阅读次数:
205