190, 3379, 693

This commit is contained in:
2026-02-20 00:37:14 +08:00
parent 68a402077a
commit e1e872380e
2 changed files with 22 additions and 0 deletions

16
26/02/190.go Normal file
View File

@@ -0,0 +1,16 @@
package A
import "math/bits"
func reverseBits(n int) int {
res := 0
for i := 0; i < 32; i++ {
res = (res << 1) | (n & 1)
n >>= 1
}
return res
}
func reverseBits2(n int) int {
return int(bits.Reverse32((uint32(n))))
}