fn part1(expense: &[i32], sum: &i32) -> Option<i32> { 
    let set: HashSet<&i32> = expense.into_iter().collect();
    for e in expense {
        let companion = sum - e;
        if set.contains(&companion) {
            return Some(e * companion);
        }
    }
    None
}
/// find the two entries that sum to 2020 and then multiply those two numbers together.
find the two entries that sum to 2020 and then multiply those two numbers together.
find the two entries that sum to 2020 and then multiply those two numbers together .
fn part1(expense: &[i32], sum: &i32) -> Option<i32> { 
    let set: HashSet<&i32> = expense.into_iter().collect();
    for e in expense {
        let companion = sum - e;
        if set.contains(&companion) {
            return Some(e * companion);
        }
    }
    None
}
fn part1 ( expense : & [ i32 ] , sum : & i32 ) -> Option < i32 > { let set : HashSet < & i32 > = expense . into_iter ( ) . collect ( ) ; for e in expense { let companion = sum - e ; if set . contains ( & companion ) { return Some ( e * companion ) ; } } None }
find the two entries that sum to 2020 and then multiply those two numbers together.
find the two entries that sum to 2020 and then multiply those two numbers together .
expense
&[i32]
sum
&i32
expense
&[i32]
sum
&i32