869. Reordered Power of 2 Medium
1/**
2 * [869] Reordered Power of 2
3 *
4 * You are given an integer n. We reorder the digits in any order (including the original order) such that the leading digit is not zero.
5 * Return true if and only if we can do this so that the resulting number is a power of two.
6 *
7 * Example 1:
8 *
9 * Input: n = 1
10 * Output: true
11 *
12 * Example 2:
13 *
14 * Input: n = 10
15 * Output: false
16 *
17 *
18 * Constraints:
19 *
20 * 1 <= n <= 10^9
21 *
22 */
23pub struct Solution {}
24
25// problem: https://leetcode.com/problems/reordered-power-of-2/
26// discuss: https://leetcode.com/problems/reordered-power-of-2/discuss/?currentPage=1&orderBy=most_votes&query=
27
28// submission codes start here
29
30impl Solution {
31 pub fn reordered_power_of2(n: i32) -> bool {
32 false
33 }
34}
35
36// submission codes end
37
38#[cfg(test)]
39mod tests {
40 use super::*;
41
42 #[test]
43 fn test_869() {
44 }
45}
46
Back
© 2025 bowen.ge All Rights Reserved.