摘要: 题目来源:http://www.lintcode.com/zh-cn/problem/compare-strings/ 先贴上错误代码,测试案例没有全部通过。不一定是顺序的。 方法一:直接法 修改之后,可以accept的程序如下: 方法二:用数组count[26]存放A中26个字母出现的次数。对B每 阅读全文
posted @ 2016-05-13 23:00 Pearl_zju 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 题目来源:http://www.lintcode.com/zh-cn/problem/reverse-words-in-a-string/ 先贴上错误代码,测试案例没有全部通过。需要对字符串中的多余空格进行处理。 修改之后,可以accept的程序如下: 可以accept的程序2如下: 阅读全文
posted @ 2016-05-13 21:04 Pearl_zju 阅读(128) 评论(0) 推荐(0) 编辑