摘要:
/** * Definition for binary tree * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */ public class BSTIterator { ... 阅读全文
摘要:
class Solution { public String fractionToDecimal(int numerator, int denominator) { StringBuilder sb=new StringBuilder(); if(numerator0||numerator>0&&denominator0) sb.a... 阅读全文
摘要:
class Solution { public int compareVersion(String version1, String version2) { String[] v1=version1.split("\\."); String[] v2=version2.split("\\."); int i=0; ... 阅读全文
摘要:
class Solution { public int maximumGap(int[] nums) { if(nums.length<2) return 0; int max=Integer.MIN_VALUE; int min=Integer.MAX_VALUE; for(int num:nums... 阅读全文
摘要:
ph 阅读全文
摘要:
class Solution { public int findPeakElement(int[] nums) { for(int i=0;i0&&nums[i]>nums[i-1])&&(i==nums.length-1||inums[i+1])) return i; return -1; } } 阅读全文
摘要:
ph 阅读全文
摘要:
ph 阅读全文
摘要:
ph 阅读全文
摘要:
ph 阅读全文