fn main() { let tests = [ (2, vec![0,1,1]), (5, vec![0,1,1,2,1,2]) ]; for test in tests { println!("{} is {:?} should be {:?}", test.0, count_bits(test.0), test.1); } } fn count_bits(n: i32) -> Vec { let mut solution: Vec = Vec::new(); for i in 0..=n { let mut ones = 0; for c in 0..32 { ones += (1<