This solution together with the solution of James' (or mine) exhibits a nice duality between the "top-down" and "bottom-up" approaches.
56162 Solvers
977 Solvers
Given an unsigned integer x, find the largest y by rearranging the bits in x
796 Solvers
155 Solvers
187 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!