LeetCode Daily Problem P3370: Smallest Integer with Only Set Bits even6292025-10-29 (Updated: 2025-10-29) algorithmBitwise Operation, LeetCode Daily Challenge, algorithm Timeline timeline2025-10-29init bit manipulation Problem:P3370 Smallest Integer with Only Set Bitshttps://leetcode.cn/problems/smallest-number-with-all-set-bits/description/?envType=daily-question&envId=2025-10-29Simple bit manipulation12345678910111213struct Solution;impl Solution { pub fn smallest_number(n: i32) -> i32 { let mut i = 1_i64; while i < n as i64 { i = (i << 1) | 1; } i as i32 }}fn main() { println!("Hello, world!");}