摘要: 题: 遍历比较。 一本正经地说一下思路。 最长前缀。 一旦找到一个不匹配,就无法做成最长前缀。 所有我们的目的就是去找这个不匹配。 注意一下字符串为空的情况,每次都会栽在这里。 为了提高效率,找出最短字符串,因为最长前缀的长度不可能超过最短字符串的长度。 哎,心累。没有用例。 阅读全文
posted @ 2017-05-11 20:49 天气晚来秋 阅读(164) 评论(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 @ 2017-05-11 15:37 天气晚来秋 阅读(170) 评论(0) 推荐(0) 编辑