uacs2024

导航

2025年11月25日 #

leetcode238. 除自身以外数组的乘积

摘要: 238. 除自身以外数组的乘积 只会违规使用除法🤡 class Solution { public int[] productExceptSelf(int[] nums) { int product = 1,firstZero = -1,secondZero = -1,n = nums.lengt 阅读全文

posted @ 2025-11-25 20:48 ᶜʸᵃⁿ 阅读(5) 评论(0) 推荐(0)

leetcode190. 颠倒二进制位

摘要: 190. 颠倒二进制位 注意,如果n转成二进制不够32位,要在最高位前面补0再反转 法一:自己写的,不太高效,return那的复杂度太高了 class Solution { public int reverseBits(int n) { StringBuilder sb = new StringBu 阅读全文

posted @ 2025-11-25 15:53 ᶜʸᵃⁿ 阅读(4) 评论(0) 推荐(0)