摘要: 219. 存在重复元素 II Solution 思路1: 重复元素 然后就用HashMap不断更新最新出现的位置 与k值判断即可。 class Solution { public boolean containsNearbyDuplicate(int[] nums, int k) { Map<Int 阅读全文
posted @ 2022-01-19 16:56 Frontierone 阅读(19) 评论(0) 推荐(0) 编辑
摘要: 539. 最小时间差 Solution 思路: 将所有时间字符串排序后 最小时间只可能是 前后相邻时间 和 首位时间。1440可以剪枝处理,因为24*60。 class Solution { public int findMinDifference(List<String> timePoints) 阅读全文
posted @ 2022-01-19 16:34 Frontierone 阅读(21) 评论(0) 推荐(0) 编辑