摘要:
public class Solution { public int trailingZeroes(int n) { int result = 0; while(n > 0){ n = n/5; result += n; ... 阅读全文
摘要:
首先 试着 用hashMap来做 习惯一下Mappublic class Solution { public int majorityElement(int[] nums) { Map hashMap = new HashMap(); for(int i = 0; ... 阅读全文
摘要:
public class Solution { public String convertToTitle(int n) { StringBuilder sb = new StringBuilder(); int round = n; while(rou... 阅读全文
摘要:
public class Solution { public int compareVersion(String version1, String version2) { String[] versionArray1 = version1.split("\\."); ... 阅读全文
摘要:
一开始试着用DP去解决, 可是两个指针怎么同步移动很费劲,想了一会脑子混乱,就建立双向linked list,思路就很清晰了。/** * Definition for singly-linked list. * public class ListNode { * int val; * ... 阅读全文