pub fn solve_n2(list: &[i32]) -> i32 {
    let (a, b) = list.iter().tuple_combinations()
        .find(|(a, b)| *a + *b == 2020)
        .expect("Nothing found.");

    a * b
}
// tag::solve_n2[]
/// Return the product of the two numbers in list that sum up to 2020.
///
/// # Examples
///
/// ```
/// let list: Vec<i32> = vec![1721, 979, 366, 299, 675, 1456];
/// let prod = mr_kaffee_2020_01::solve_n2(&list);
/// assert_eq!(prod, 514_579);
/// ```
:solve_n2[]
Return the product of the two numbers in list that sum up to 2020.
: solve_n2 [] Return the product of the two numbers in list that sum up to 2020 .
pub fn solve_n2(list: &[i32]) -> i32 {
    let (a, b) = list.iter().tuple_combinations()
        .find(|(a, b)| *a + *b == 2020)
        .expect("Nothing found.");
    a * b
}
pub fn solve_n2 ( list : & [ i32 ] ) -> i32 { let ( a , b ) = list . iter ( ) . tuple_combinations ( ) . find ( | ( a , b ) | * a + * b == 2020 ) . expect ( " " ) ; a * b }
tag::solve_n2[]
Return the product of the two numbers in list that sum up to 2020.
tag :: solve_n2 [] Return the product of the two numbers in list that sum up to 2020 .
list
&[i32]
list
&[i32]
examples
None