Discover MakerZone

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

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!

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

Created by AMITAVA BISWAS

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.

Tags

Problem Group

Solution Statistics

436 correct solutions 251 incorrect solutions
Last solution submitted on Apr 22, 2016

Problem Comments

Solution Comments