cKK

............当你觉得自己很辛苦,说明你正在走上坡路.............坚持做自己懒得做但是正确的事情,你就能得到别人想得到却得不到的东西............

导航

06 2015 档案

摘要:注意:1.怎么至返回一次 2.循环里使用al.remove,al.size()也会变/*Given an array of integers, find two numbers such that they add up to a specific target number.The func... 阅读全文

posted @ 2015-06-04 13:44 cKK 阅读(234) 评论(0) 推荐(0)

摘要:eclipse没问题,leetcode 1不能通过,超出int最大值了,但是怎么转无符号?/*Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known a... 阅读全文

posted @ 2015-06-03 23:56 cKK 阅读(160) 评论(0) 推荐(0)

摘要:/*Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as the Hamming weight).For example, the 32-bit... 阅读全文

posted @ 2015-06-03 22:13 cKK 阅读(136) 评论(0) 推荐(0)

摘要:主意利用asc码 /*Given a column title as appear in an Excel sheet, return its corresponding column number. For example: A -> 1 B -> 2 C -> 3 ... Z -> 26 AA 阅读全文

posted @ 2015-06-03 21:45 cKK 阅读(192) 评论(0) 推荐(0)

摘要:/*Write an algorithm to determine if a number is "happy".A happy number is a number defined by the following process: Starting with any positive integ... 阅读全文

posted @ 2015-06-03 21:11 cKK 阅读(238) 评论(0) 推荐(0)

摘要:超时版:/*Given two strings s and t, determine if they are isomorphic.Two strings are isomorphic if the characters in s can be replaced to get t.All occur... 阅读全文

posted @ 2015-06-03 00:18 cKK 阅读(223) 评论(0) 推荐(0)

摘要:超时版:/*Contains Duplicate II Given an array of integers and an integer k, find out whether there there are two distinct indices i and j in the array su... 阅读全文

posted @ 2015-06-02 11:09 cKK 阅读(259) 评论(0) 推荐(0)

摘要://Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the a... 阅读全文

posted @ 2015-06-02 11:07 cKK 阅读(144) 评论(0) 推荐(0)

摘要:/*Runtime对象该类并没有提供构造函数。说明不可以new对象。那么会直接想到该类中的方法都是静态的。发现该类中还有非静态方法。说明该类肯定会提供了方法获取本类对象。而且该方法是静态的,并返回值类型是本类类型。由这个特点可以看出该类使用了单例设计模式完成。该方式是static Runtime g... 阅读全文

posted @ 2015-06-01 20:25 cKK 阅读(211) 评论(0) 推荐(0)

摘要:import java.util.*;/*两个练习:1,获取任意年的二月有多少天。 思路:根据指定年设置一个时间就是 c.set(year,2,1)//某一年的3月1日。 c.add(Calenar.DAY_OF_MONTH,-1);//3月1日,往前推一天,就是2月最后一天。2... 阅读全文

posted @ 2015-06-01 20:24 cKK 阅读(150) 评论(0) 推荐(0)