mirror of https://github.com/01-edu/public.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
271 B
26 lines
271 B
6 years ago
|
## reversebits
|
||
6 years ago
|
|
||
6 years ago
|
### Instructions
|
||
6 years ago
|
|
||
5 years ago
|
Write a function that takes a `byte`, reverses it `bit` by `bit` (as shown in the example) and returns the result.
|
||
5 years ago
|
|
||
5 years ago
|
### Expected function
|
||
5 years ago
|
|
||
5 years ago
|
```go
|
||
5 years ago
|
|
||
5 years ago
|
func ReverseBits(oct byte) byte {
|
||
5 years ago
|
|
||
|
}
|
||
5 years ago
|
```
|
||
5 years ago
|
|
||
|
Example:
|
||
|
|
||
5 years ago
|
1 byte
|
||
|
|
||
|
---
|
||
|
|
||
|
0010 0110
|
||
|
||
|
||
|
\/
|
||
|
0110 0100
|