# Is this how auto-correct works?

**Computer Science**Level 4

Substitution: Replacing a single character from \(a\) so that it matches \(b\) costs \(1\). If \(a=\text{rot}\) and \(b=\text{dot}\). Then \(f(a,b)=1\).

Insertion: Inserting a single character also costs \(1\). Ie, If \(a = \text{girl}\) and \(b=\text{girls}\), then \(f(a,b)=1\).

Deletion: Deleting a single character also costs \(1\). Ie. If \(a=\text{hour}\) and \(b=\text{our}\) then \(f(a,b)=1\).

Given \(a\) and \(b\), compute \(f(a,b)\).