LeetCode #405 Convert A Number to Hexadecimal
这题我特么WA了两次,气死爸爸了。
tips:
- 了解原码、反码(one’s complement)、补码(two’s complement)。
- 了解位运算(bitwise operation)。
- 不要被题目的大于零、小于零什么的迷惑!负数基本适配于正数的算法,因为他们本质都是进制进过位运算得到的,这就是补码的优越性,有时间可以自行认真推导一下。
Bitwise / AC
|
|
LeetCode #405 Convert A Number to Hexadecimal
这题我特么WA了两次,气死爸爸了。
|
|
近期评论