摘要: 就用除法 class Solution { public int[] productExceptSelf(int[] nums) { int[] answer = new int[nums.length]; int sum = 1; int zeroNum = 0; for (int i = 0; 阅读全文
posted @ 2024-02-07 16:01 破忒头头 阅读(11) 评论(0) 推荐(0)
摘要: 先来个大的 class RandomizedSet { private HashSet<Integer> hashSet; public RandomizedSet() { hashSet = new HashSet<Integer>(); } public boolean insert(int v 阅读全文
posted @ 2024-02-07 14:40 破忒头头 阅读(11) 评论(0) 推荐(0)
摘要: 排序,i代表至少发表的论文数量 时间复杂度:O(nlogn) 空间复杂度:O(logn) class Solution { public int hIndex(int[] citations) { // 0 1 3 5 6 int length = citations.length; Arrays. 阅读全文
posted @ 2024-02-07 11:14 破忒头头 阅读(23) 评论(0) 推荐(0)