摘要:
解答从这里来比较麻烦的字符串细节实现题。需要解决以下几个问题:首先要能判断多少个word组成一行: 这里统计读入的所有words的总长curLen,并需要计算空格的长度。假如已经读入words[0:i]。当curLen + i L时,一行结束。知道一行的所有n个words,以及总长curLen之后... 阅读全文
摘要:
/* * Check if two trees are the same */public class Solution { public boolean isSameTree(TreeNode p, TreeNode q) { if(p == null && q... 阅读全文
摘要:
见过在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... 阅读全文