| 3 | using namespace std; |
| 4 | |
| 5 | int main() |
| 6 | { |
| 7 | int n,count=0; |
| 8 | string s,t; |
| 9 | cin>>n; |
| 10 | cin>>s; |
| 11 | cin>>t; |
| 12 | if(s.compare(t) ==0) // check if both the strings are same or not |
| 13 | cout<<0<<endl; |
| 14 | else |
| 15 | { |
| 16 | for(int i=n-1;i>=0;i--) |
| 17 | |
| 18 | { |
| 19 | count++; |
| 20 | s.erase(0,1); // remove start character from string s |
| 21 | t.erase(i,1); // remove last character from string t |
| 22 | if(s.compare(t)==0) // if botth the strings are same then break |
| 23 | break; |
| 24 | } |
| 25 | cout<<count<<endl; // print the minimum number to convert s to t. |
| 26 | } |
| 27 | |
| 28 | |
| 29 | } |
nothing calls this directly
no outgoing calls
no test coverage detected