2015年4月5日
摘要: 解答从这里来比较麻烦的字符串细节实现题。需要解决以下几个问题:首先要能判断多少个word组成一行: 这里统计读入的所有words的总长curLen,并需要计算空格的长度。假如已经读入words[0:i]。当curLen + i L时,一行结束。知道一行的所有n个words,以及总长curLen之后... 阅读全文
posted @ 2015-04-05 11:10 Seth_L 阅读(151) 评论(0) 推荐(0) 编辑
摘要: /* * Check if two trees are the same */public class Solution { public boolean isSameTree(TreeNode p, TreeNode q) { if(p == null && q... 阅读全文
posted @ 2015-04-05 10:13 Seth_L 阅读(103) 评论(0) 推荐(0) 编辑
摘要: 见过在onsite的居多Given a list of houses and the cost of painting each house, the houses can be painted in three colors RED, GREEN and BLUE, two nei... 阅读全文
posted @ 2015-04-05 09:22 Seth_L 阅读(146) 评论(0) 推荐(0) 编辑