摘要: The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1 is read off as "one 1" or 11.11 is read off ... 阅读全文
posted @ 2015-03-20 16:23 hongchun_z 阅读(182) 评论(0) 推荐(0) 编辑
摘要: Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string.If the last word ... 阅读全文
posted @ 2015-03-20 15:38 hongchun_z 阅读(138) 评论(0) 推荐(0) 编辑
摘要: Given two binary strings, return their sum (also a binary string).For example,a = "11"b = "1"Return "100";思路: 对齐, 计算当前位和进位;如果位较长,让我想到了先行进位加法器,不过这里的计算不... 阅读全文
posted @ 2015-03-20 10:39 hongchun_z 阅读(131) 评论(0) 推荐(0) 编辑