Smallest Number With All Set Bits

Given a positive integer n, find the smallest number >= n whose binary representation consists entirely of set bits (i.e., of the form 2^k - 1). Return that number.

Examples
Input: 5
Output: 7
Hints

Smallest Number With All Set Bits

Given a positive integer n, find the smallest number >= n whose binary representation consists entirely of set bits (i.e., of the form 2^k - 1). Return that number.