笔记
一只特立独行的汪
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
二分法
二分法 leetcode 410、875、774 public int minEatingSpeed(int[] piles, int H) { int left = 1; int right = Integer.MIN_VALUE; for(int i=0;i<piles.length;i++){ //left = Math.min(left,piles[i]); right = Math.max(ri原创 2020-12-10 16:37:03 · 434 阅读 · 0 评论 -
JAVA中哈希表的使用-遍历map集合
java中哈希表的使用第二例—即将罗马数字转换为整数 代码: class Solution { public int romanToInt(String s) { HashMap<Character,Integer> map = new HashMap<Character,Integer>(); map.put(‘I’,1); map.put(‘V’,5); map.put(‘X’,10); map.put(‘L’,50); map.put(‘C’,100); map.put(‘D’原创 2020-10-06 22:03:37 · 754 阅读 · 0 评论
分享