fn find_box_ids<'a>(all_ids: &[&'a str]) -> Option<(&'a str, &'a str)> {
    for (index, &first_id) in all_ids[0..all_ids.len() - 1].iter().enumerate() {
        if let Some(second_id) = all_ids[index + 1..]
            .iter()
            .find(|&&id| count_differences(first_id, id) == 1)
        {
            return Some((first_id, second_id));
        }
    }

    None
}
/// Finds the pair of box IDs that differ by exactly one character.
Finds the pair of box IDs that differ by exactly one character.
Finds the pair of box IDs that differ by exactly one character .
fn find_box_ids<'a>(all_ids: &[&'a str]) -> Option<(&'a str, &'a str)> {
    for (index, &first_id) in all_ids[0..all_ids.len() - 1].iter().enumerate() {
        if let Some(second_id) = all_ids[index + 1..]
            .iter()
            .find(|&&id| count_differences(first_id, id) == 1)
        {
            return Some((first_id, second_id));
        }
    }
    None
}
fn find_box_ids < ' a > ( all_ids : & [ & ' a str ] ) -> Option < ( & ' a str , & ' a str ) > { for ( index , & first_id ) in all_ids [ 0 .. all_ids . len ( ) - 1 ] . iter ( ) . enumerate ( ) { if let Some ( second_id ) = all_ids [ index + 1 .. ] . iter ( ) . find ( | & & id | count_differences ( first_id , id ) == 1 ) { return Some ( ( first_id , second_id ) ) ; } } None }
Finds the pair of box IDs that differ by exactly one character.
Finds the pair of box IDs that differ by exactly one character .
all_ids
&[&'a str]
all_ids
&[&'a str]