pub fn find_longest_shared_prefix(list: &[String]) -> usize {
    let mut longest_shared_prefix = 0;
    for word1 in list {
        for word2 in list {
            if word1 != word2 {
                // Here we convert from zero-indexed first different to
                // the (1-indexed) length of the long shared prefix, so we don't
                // need a `- 1`.
                let this_shared_prefix_length =
                    find_first_different_character_zero_indexed(word1, word2);
                if this_shared_prefix_length > longest_shared_prefix {
                    longest_shared_prefix = this_shared_prefix_length;
                }
            }
        }
    }
    longest_shared_prefix
}
/// Nested loops in this function get the `longest_shared_prefix`
/// between any two words on the given list. Returns length of this
/// longest shared prefix, a notable cryptographic metric.
Nested loops in this function get the `longest_shared_prefix`
between any two words on the given list. Returns length of this
longest shared prefix, a notable cryptographic metric.
Nested loops in this function get the ` longest_shared_prefix ` between any two words on the given list . Returns length of this longest shared prefix a notable cryptographic metric .
pub fn find_longest_shared_prefix(list: &[String]) -> usize {
    let mut longest_shared_prefix = 0;
    for word1 in list {
        for word2 in list {
            if word1 != word2 {
                // Here we convert from zero-indexed first different to
                // the (1-indexed) length of the long shared prefix, so we don't
                // need a `- 1`.
                let this_shared_prefix_length =
                    find_first_different_character_zero_indexed(word1, word2);
                if this_shared_prefix_length > longest_shared_prefix {
                    longest_shared_prefix = this_shared_prefix_length;
                }
            }
        }
    }
    longest_shared_prefix
}
pub fn find_longest_shared_prefix ( list : & [ String ] ) -> usize { let mut longest_shared_prefix = 0 ; for word1 in list { for word2 in list { if word1 != word2 { // Here we convert from zero-indexed first different to // the (1-indexed) length of the long shared prefix, so we don't // need a `- 1`. let this_shared_prefix_length = find_first_different_character_zero_indexed ( word1 , word2 ) ; if this_shared_prefix_length > longest_shared_prefix { longest_shared_prefix = this_shared_prefix_length ; } } } } longest_shared_prefix }
Nested loops in this function get the `longest_shared_prefix`
between any two words on the given list.
Nested loops in this function get the ` longest_shared_prefix ` between any two words on the given list .
list
&[String]
list
&[String]