(x: u32)
| 15 | ]; |
| 16 | |
| 17 | pub fn power_of_4_with_index(x: u32) -> Option<usize> { |
| 18 | // Check if the number is 0 (not a power of 4) |
| 19 | if x == 0 { |
| 20 | return None; |
| 21 | } |
| 22 | // Check if x is in the list of powers of 4 and return its index |
| 23 | match POWERS_OF_4.iter().position(|&power| power == x) { |
| 24 | Some(index) => Some(index), |
| 25 | None => None, |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | #[derive(Debug)] |
| 30 | struct VersionNode { |