摘要: public class Solution { public int reverse(int x) { int ret=0; while(x!=0) { int t=x%10; ret=ret*10+t; ... 阅读全文
posted @ 2014-07-22 21:21 hansongjiang8 阅读(115) 评论(1) 推荐(1) 编辑
摘要: 不想看知道一点就行。学点位运算也是好的。http://www.cnblogs.com/lihaozy/archive/2012/12/31/2840437.htmlpublic class Solution { public List grayCode(int n) { int ... 阅读全文
posted @ 2014-07-22 19:42 hansongjiang8 阅读(94) 评论(0) 推荐(0) 编辑
摘要: 用了一个多小时,根据测试用例如果当前为0,前面必须为1,或者2,并且两者组合成一个dp[i]=dp[i-2];其他情况就简单一些,一定能dp[i-1]和这个单独,可能d[i-2] 1 public class Solution { 2 public boolean isTwo(int a,i... 阅读全文
posted @ 2014-07-22 19:19 hansongjiang8 阅读(127) 评论(0) 推荐(0) 编辑