Cody

Problem 108. Given an unsigned integer x, find the largest y by rearranging the bits in x

Created by AMITAVA BISWAS in Community

Given an unsigned integer x, find the largest y by rearranging the bits in x.

Example:

 Input  x = 10
 Output y is 12

since 10 in binary is 1010 and 12 in binary is 1100.

Solution Stats

60.49% Correct | 39.51% Incorrect
Last solution submitted on Jan 28, 2019

Problem Comments

Solution Comments

Recent Solvers461

Suggested Problems

More from this Author100

Tags

Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!