fn main() { println!("Hello, world!"); let tests = [ (vec![2,7,11,15], 9, vec![0,1]), (vec![3,2,4], 6, vec![1,2]), (vec![3,3], 6, vec![0,1]) ]; for test in tests { println!("{:?} at {} is {:?} should be {:?}", test.0, test.1, two_sum(test.0.clone(), test.1), test.2 ); } } pub fn two_sum(nums: Vec, target: i32) -> Vec { for i in 0..nums.len()-1 { for ii in i+1..nums.len() { if nums[i] + nums[ii] == target { return vec![i as i32, ii as i32]; } } } return vec![0,0]; }