Guest User

Untitled

a guest
Jan 23rd, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. class Solution:
  2. """
  3. 结果左移,原数右移,末尾相加!
  4. """
  5. # @param n, an integer
  6. # @return an integer
  7. def reverseBits(self, n):
  8. result = 0
  9. for i in xrange(32):
  10. result <<= 1
  11. result |= n & 1
  12. n >>= 1
  13. return result
Add Comment
Please, Sign In to add comment