Cody

Problem 2735. Binary Neighbourhood

Given a natural number reorder its binary form to create another number, closest to the given one.

Examples:

  • 1 gives 2, ( 1(dec) > 1 > 01 > 10 > 2(dec) )
  • 2 gives 1, ( 2(dec) > 10 > 01 > 1(dec) )
  • 5 gives 6, ( 5(dec) > 101 > 110 > 6(dec) )

Solution Stats

62.26% Correct | 37.74% Incorrect
Last Solution submitted on Jun 02, 2020

Problem Comments

Problem Recent Solvers33

Suggested Problems

More from this Author41

Problem Tags