摘要:
https://oj.leetcode.com/problems/longest-common-prefix/在多个string的集合中,找出所有string的最长公共前缀。从头开始 index 如果 所有string的 index位都相等,则index ++string是一个类,如果是 空stri...
阅读全文
posted @ 2014-07-23 22:28
qingcheng奕
阅读(98)
推荐(0)
摘要:
https://oj.leetcode.com/problems/length-of-last-word/对一个字符串遍历,求最后一个单词的长度,如果有 ‘ ’,则切开了。字符串的最后一个字符为 '\0'NULL和“”是有区别的:NULL是 0x00000 , ""是长度为1的串,里面只有结尾元素,...
阅读全文
posted @ 2014-07-23 21:40
qingcheng奕
阅读(98)
推荐(0)
摘要:
@表示有更优解法https://oj.leetcode.com/problems/integer-to-roman/将自然数,转换成罗马数字,输入范围为 1 ~ 3999,因为罗马数没有0.用一个map,表示 1 ~ 9, 10 ~ 90, 100 ~ 900, 1000 ~ 3000,然后,把相应...
阅读全文
posted @ 2014-07-23 20:51
qingcheng奕
阅读(137)
推荐(0)