摘要:
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 阅读全文
摘要:
Write a function to find the longest common prefix string amongst an array of strings. 解法: 广度优先搜索:先比较所有字符串的第一个字符,然后比较第二个。。。。如果某一行没有了(说明其为最短的单词)或者遇到不匹配 阅读全文
摘要:
Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999. 解法: 只要考虑两种情况即可: 第一,如果当前数字是最后一个数字,或者之后的数字比它 阅读全文