Skip to content

Commit

Permalink
Time: 4 ms (38.58%), Space: 2.5 MB (33.56%) - LeetHub
Browse files Browse the repository at this point in the history
  • Loading branch information
hovanhoa committed Jan 25, 2024
1 parent 573bef6 commit 5b889e6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions 0190-reverse-bits/0190-reverse-bits.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
func reverseBits(num uint32) uint32 {
var answer uint32
for i := 0; i < 32 ; i++{
answer=answer | (num&1)<<(31-i)
num=num>>1
}
return answer
}

0 comments on commit 5b889e6

Please sign in to comment.