Math
题目列表
- strobogrammatic number
- count primes
Base conversion: decimal to/from binary
Decimal to binary
we get the result from right to left
- module to get the rightmost digit
- divide by 2 and go to 1
binary to decimal
we get the result from left to right
result = result * 2 + cur_digit- go to next digit