fn one_edit_insert(s1: &str, s2: &str) -> bool {
    let mut index1 = 0;
    let mut index2 = 0;

    while index2 < s2.len() && index1 < s1.len() {
        if s1.as_bytes()[index1] != s2.as_bytes()[index2] {
            if index1 != index2 {
                return false;
            }
            index2 += 1;
        } else {
            index1 += 1;
            index2 += 1;
        }
    }

    true
}
/// Check if you can insert a character into s1 to make s2
Check if you can insert a character into s1 to make s2
Check if you can insert a character into s1 to make s2
fn one_edit_insert(s1: &str, s2: &str) -> bool {
    let mut index1 = 0;
    let mut index2 = 0;
    while index2 < s2.len() && index1 < s1.len() {
        if s1.as_bytes()[index1] != s2.as_bytes()[index2] {
            if index1 != index2 {
                return false;
            }
            index2 += 1;
        } else {
            index1 += 1;
            index2 += 1;
        }
    }
    true
}
fn one_edit_insert ( s1 : & str , s2 : & str ) -> bool { let mut index1 = 0 ; let mut index2 = 0 ; while index2 < s2 . len ( ) && index1 < s1 . len ( ) { if s1 . as_bytes ( ) [ index1 ] != s2 . as_bytes ( ) [ index2 ] { if index1 != index2 { return false ; } index2 += 1 ; } else { index1 += 1 ; index2 += 1 ; } } true }
Check if you can insert a character into s1 to make s2
Check if you can insert a character into s1 to make s2
s1
&str
s2
&str
s1
&str
s2
&str