GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • 注册
  • Plus 会员

This view

  • Original page
  • New address

GeezerVison is showing leetcode.cn — 190. 颠倒二进制位 - 力扣(LeetCode)

题目描述
题目描述
题解
题解
提交记录
提交记录
190. 颠倒二进制位
简单

颠倒给定的 32 位有符号整数的二进制位。

 

示例 1:

输入:n = 43261596

输出:964176192

解释:

整数二进制
4326159600000010100101000001111010011100
96417619200111001011110000010100101000000

示例 2:

输入:n = 2147483644

输出:1073741822

解释:

整数二进制
214748364401111111111111111111111111111100
107374182200111111111111111111111111111110

 

提示:

  • 0 <= n <= 231 - 2
  • n 为偶数

 

进阶: 如果多次调用这个函数,你将如何优化你的算法?

 
代码
代码
测试用例
测试用例
测试结果
测试结果
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.