摘要: public class Solution { public int trailingZeroes(int n) { int result = 0; while(n > 0){ n = n/5; result += n; ... 阅读全文
posted @ 2016-01-08 11:35 爱推理的骑士 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 首先 试着 用hashMap来做 习惯一下Mappublic class Solution { public int majorityElement(int[] nums) { Map hashMap = new HashMap(); for(int i = 0; ... 阅读全文
posted @ 2016-01-08 08:14 爱推理的骑士 阅读(124) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public String convertToTitle(int n) { StringBuilder sb = new StringBuilder(); int round = n; while(rou... 阅读全文
posted @ 2016-01-08 07:34 爱推理的骑士 阅读(101) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public int compareVersion(String version1, String version2) { String[] versionArray1 = version1.split("\\."); ... 阅读全文
posted @ 2016-01-08 06:44 爱推理的骑士 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 一开始试着用DP去解决, 可是两个指针怎么同步移动很费劲,想了一会脑子混乱,就建立双向linked list,思路就很清晰了。/** * Definition for singly-linked list. * public class ListNode { * int val; * ... 阅读全文
posted @ 2016-01-08 04:38 爱推理的骑士 阅读(455) 评论(0) 推荐(0) 编辑