Search
⌘K

Leetcode 2864. Maximum Odd Binary Number

Rearrange the bits of a binary string (which contains at least one '1') to form the largest possible odd binary number; since oddness requires the last bit to be '1', reserve one '1' for the end and maximize the prefix by placing the remaining '1's in the most significant positions.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.