摘要:
有序集合+滑动窗口 import java.util.TreeSet; class Solution { public boolean containsNearbyAlmostDuplicate(int[] nums, int k, int t) { /** * 有序集合+滑动窗口 * 因为满足ab 阅读全文
posted @ 2021-12-08 21:12
振袖秋枫问红叶
阅读(43)
评论(0)
推荐(0)
摘要:
集合 import java.util.HashSet; class Solution { public boolean containsDuplicate(int[] nums) { HashSet<Integer> set = new HashSet<>(); for (int i = 0; i 阅读全文
posted @ 2021-12-08 17:52
振袖秋枫问红叶
阅读(30)
评论(0)
推荐(0)
摘要:
暴力解法 class Solution { public int maxPoints(int[][] points) { int max = 1; /** * 暴力解法 * 直接将前两个点组成一条直线,然后比较后面的点看有没有在同一直线的 */ for (int i = 0; i < points. 阅读全文
posted @ 2021-12-08 17:09
振袖秋枫问红叶
阅读(45)
评论(0)
推荐(0)
摘要:
集合 import java.util.HashMap; class Solution { public int numberOfBoomerangs(int[][] points) { int count = 0; for (int i = 0; i < points.length; i++) { 阅读全文
posted @ 2021-12-08 14:13
振袖秋枫问红叶
阅读(43)
评论(0)
推荐(0)
摘要:
集合 import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; class Solution { public List<List<String>> gr 阅读全文
posted @ 2021-12-08 10:37
振袖秋枫问红叶
阅读(45)
评论(0)
推荐(0)

浙公网安备 33010602011771号