Tap here to switch tabs
Problem
Submissions

Problem: Reordered Power of 2

med
30 min
Try to solve the Reordered Power of 2 problem.

Statement

Given an integer n, determine whether the digits of n can be rearranged to form a power of two. Each digit must be used exactly once in the rearrangement, and the resulting number must not have leading zeros. Return true if such a rearrangement exists, otherwise return false.

Note: A rearrangement is not allowed to produce a number with leading zeros.

Constraints:

  • 1≤1 \leq n ≤109\leq 10^9

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Reordered Power of 2

med
30 min
Try to solve the Reordered Power of 2 problem.

Statement

Given an integer n, determine whether the digits of n can be rearranged to form a power of two. Each digit must be used exactly once in the rearrangement, and the resulting number must not have leading zeros. Return true if such a rearrangement exists, otherwise return false.

Note: A rearrangement is not allowed to produce a number with leading zeros.

Constraints:

  • 1≤1 \leq n ≤109\leq 10^9