@@ -0,0 +1,1762 @@
+package leetcode.valid_number;%0A%0Apublic class Solution %7B%0A%0A%09public boolean isExponent(String s)%7B%0A%09%09if(s.length() == 0) return false;%0A%09%09int first = s.toLowerCase().indexOf('e');%0A%09%09int last = s.toLowerCase().lastIndexOf('e');%0A%09%09if(first != last) return false;%0A%09%09if(first %3C 0) return false;%0A%09%09return isFloat(s.substring(0, first)) && isInteger(s.substring(first + 1));%0A%09%7D%0A%09%0A%09public boolean isFloat(String s)%7B%0A%09%09if(s.length() == 0) return false;%0A%09%09if(isInteger(s)) return true;%0A%09%09int first = s.indexOf('.');%0A%09%09int last = s.lastIndexOf('.');%0A%09%09if(first != last) return false;%0A%09%09if(first %3C 0) return false;%0A%09%09int start = 0;%0A%09%09if(s.charAt(0) == '+' %7C%7C s.charAt(0) == '-') start = 1;%0A%09%09if(isAllDigit(s.substring(start, first), true) && isAllDigit(s.substring(first + 1), false)) return true;%0A%09%09if(isAllDigit(s.substring(start, first), false) && isAllDigit(s.substring(first + 1), true)) return true;%0A%09%09return false;%0A%09%7D%0A%09%0A%09public boolean isAllDigit(String s, boolean canBeEmpty)%7B%0A%09%09if(s.length() == 0 && !canBeEmpty) return false;%0A%09%09char %5B%5D chars = s.toCharArray();%0A%09%09for(int i = 0; i %3C chars.length; i++)%7B%0A%09%09%09char c = chars%5Bi%5D;%0A%09%09%09if(!Character.isDigit(c)) return false;%0A%09%09%7D%0A%09%09return true;%0A%09%7D%0A%09%0A%09public boolean isInteger(String s)%7B%0A%09%09if(s.length() == 0) return false;%0A%09%09char%5B%5D chars = s.toCharArray();%0A%09%09if(chars%5B0%5D == '+' %7C%7C chars%5B0%5D == '-') return isAllDigit(s.substring(1), false);%0A%09%09return isAllDigit(s, false);%0A%09%7D%0A%09%0A    public boolean isNumber(String s) %7B%0A    %09s = s.trim();%0A    %09if(s.length() == 0) return false;%0A    %09// floating point%0A    %09if(isFloat(s)) return true;%0A    %09// Exponent +1e10%0A    %09if(isExponent(s)) return true;%0A    %09return false;%0A    %7D%0A    %0A    public static void main(String%5B%5D args)%7B%0A    %09System.err.println(new Solution().isNumber(%22-.%22));%0A    %7D%0A%7D%0A

Add java solution for 65. Valid Number