7-4日刷题
摘要:Subarray Sum Closest1. 保存,然后对sum[i + 1]排序,然后找出相邻值之间的最小差。2. TreeMap:ceilingEntry返回一个键-值映射关系,它与大于等于给定键的最小键关联Value。floorEntry:返回小于等于给定键的最大键关联Value。 pu...
阅读全文
7-3日刷题
摘要:今天搜寒冬的面试杀手题——大草原,发现是以前的机试第四题,这道题跪了让我后悔一生。到现在我唯一知道的是这道题可以用贪心算法骗分。http://stackoverflow.com/questions/15882202/minimum-number-of-circles-with-radius-r-to...
阅读全文
7-2日刷题
摘要:3 Sum Closest public int threeSumClosest(int[] numbers ,int target) { // write your code here int minEr = Integer.MAX_VALUE; i...
阅读全文
7-1日刷题
摘要:Roman to Integer public int romanToInt(String s) { //数字:Ⅰ(1)Ⅴ(5)Ⅹ(10)L(50)C(100)D(500)M(1000) HashMap map = new HashMap(); ma...
阅读全文