Generation

generate functionSat, 12 Nov 2022

Check if all elements of vector are power of two

fn all_pow_two(vec: &Vec<i32>) -> bool { for element in vec { if element % 2 != 0 { return false } } true }

Questions about programming?Chat with your personal AI assistant