摘要: public void rotate(int[] nums, int k) { int n = nums.length; int [] tmp = new int [k]; int j=0; int i =0; k... 阅读全文
posted @ 2015-06-30 15:59 puckpuck 阅读(155) 评论(0) 推荐(0) 编辑
摘要: long startTime=System.currentTimeMillis(); //获取开始时间 doSomeThing(); //测试的代码段 long endTime=System.currentTimeMillis(); //获取结束时间 System.out.println... 阅读全文
posted @ 2015-06-30 13:49 puckpuck 阅读(195) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public boolean isHappy(int n) { Set set = new HashSet(); while(n != 1 && !set.contains(n)){ set.add(n); i... 阅读全文
posted @ 2015-06-30 09:57 puckpuck 阅读(133) 评论(0) 推荐(0) 编辑