LeetCode 190 题目解答:LeetCode 190 题又该怎么解答呢?希望下面的文章对大家有所帮助。
第一次 AC 代码:
- class Solution {
- public: uint32_t reverseBits(uint32_t n) {
- uint32_t ret = 0;
- int length = sizeof(n) * 8;
- for (int i = 0, j = length - 1; i > 1;
- }
- return ret;
- }
- };
第二次 AC 代码(参考了大神的代码):
- class Solution {
- public: uint32_t reverseBits(uint32_t n) {
- int length = sizeof(n) * 8;
- int ret = 0;
- for (int i = 0; i > i & 1);
- return ret;
- }
- };
就爱阅读 www.92to.com 网友整理上传, 为您提供最全的知识大全, 期待您的分享,转载请注明出处。
来源: http://www.92to.com/bangong/2017/04-13/20368457.html