Download 10-week-algorithm-excercise-master/Week_08/190/reverse_bits.go from Dorothydu/gitrepo_20: direct link, hf CLI and curl.
- Browser
- Download file 164 Bytes
-
https://huggingface.co/datasets/Dorothydu/gitrepo_20/resolve/main/10-week-algorithm-excercise-master/Week_08/190/reverse_bits.go
- Command line
-
hf download hf://datasets/Dorothydu/gitrepo_20/10-week-algorithm-excercise-master/Week_08/190/reverse_bits.go
-
curl -L -o reverse_bits.go https://huggingface.co/datasets/Dorothydu/gitrepo_20/resolve/main/10-week-algorithm-excercise-master/Week_08/190/reverse_bits.go
164 Bytes
| package main | |
| func reverseBits(num uint32) uint32 { | |
| pow, ans := uint32(31), uint32(0) | |
| for num > 0 { | |
| ans += (1 & num) << pow | |
| pow-- | |
| num >>= 1 | |
| } | |
| return ans | |
| } |