# Sprint 2 Module Project 1 ## csReverseIntegerBits ``` # Runtime: O(n) # Space: O(1) def csReverseIntegerBits(n): bits = bin(n)[2:] return int("0b" + bits[::-1], 2) ``` ## csBinaryToAscii ``` # Runtime: O(n) # Space: O(n) def csBinaryToASCII(binary): curr = 0 res = "" while curr < len(binary): letterBits = "0b" + binary[curr:curr + 8] characterEncodingValue = int(letterBits, 2) res += chr(characterEncodingValue) curr += 8 return res ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up