写出将字符串中的数字转换为整型的方法,如:"as31d2v"->312,并写出相应的单元测试,输入超过int范围时提示不合法输入. public struct ConvertResult { public ConvertState State; public int Number; } public enum ConvertState { // 输入不合法 InValid = , // 输入合法 Valid = } public class StringHelper { publ…
一直直到bug-free.不能错任何一点. 思路不清晰:刷两天. 做错了,刷一天. 直到bug-free.高亮,标红. 185,OA(YAMAXUN)--- (1) findFirstDuplicate string in a list of string. import java.util.HashSet; import java.util.Set; public class Solution { public static void main(String[] args) { String[…
//设置节假日的数组 var holiday = Array('2016-04-30','2016-05-01','2016-05-02','2016-06-09','2016-06-10','2016-06-11','2016-09-15','2016-09-16','2016-09-17','2016-10-1','2016-10-01','2016-10-02','2016-10-03','2016-10-04','2016-10-05','2016-10-06','201…
面试题61:把二叉树打印成多行 public class Solution { public ArrayList<ArrayList<Integer> > Print(TreeNode pRoot) { ArrayList<ArrayList<Integer>> res = new ArrayList<ArrayList<Integer>>(); travel(pRoot,res,0); return res; } public vo…