Home
Log in
DescriptionSubmissionsSolution
DescriptionSubmissionsSolution
Loading...

Log in to run or submit

n =

Codey

Practise coding problems, test your solutions and track your progress.

Explore

  • Problems
  • About
  • Contact

Legal

  • Privacy Policy
  • Terms of Use

© 2026 Codey. Personal learning project.

Solution
Updated: 2026-02-23

Idea

Build reversed bits by shifting result left and taking lowest bit from input.

Approach

Repeat 32 times: res = (res<<1) | (n&1), then n >>= 1.

Code
Loading...
Complexity
Time: O(1)
Space: O(1)
Solution
Updated: 2026-02-23

Idea

Build reversed bits by shifting result left and taking lowest bit from input.

Approach

Repeat 32 times: res = (res<<1) | (n&1), then n >>= 1.

Code
Loading...
Complexity
Time: O(1)
Space: O(1)