摘要: 题目描述: Given a roman numeral, convert it to an integer. 解题思路: 罗马计数法有以下规则: 基本数字 Ⅰ、X 、C 中的任何一个、自身连用构成数目、或者放在大数的右边连用构成数目、都不能超过三个;放在大数的左边只能用一个; 不能把基本数字 V 、 阅读全文
posted @ 2016-06-14 01:52 godlei 阅读(186) 评论(0) 推荐(0)
摘要: 题目描述: Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 to 3999. 解题思路: 注意到用例比较少,所以采用以空间换时间的方法,把所有的结果列 阅读全文
posted @ 2016-06-14 01:44 godlei 阅读(318) 评论(0) 推荐(0)
摘要: 题目描述: 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 阅读全文
posted @ 2016-06-14 01:40 godlei 阅读(466) 评论(0) 推荐(0)
摘要: 题目描述: Implement regular expression matching with support for '.' and '*'. 解题思路: 这道题如果只考虑“.”的话其实很好完成,所以解题的关键在于处理“*”的情况。以为“*”与前一个字母有关,所以应该整体考虑ch*……的情况。c 阅读全文
posted @ 2016-06-14 01:31 godlei 阅读(212) 评论(0) 推荐(0)