1 solutions

  • 0
    @ 2022-8-28 21:42:40
    #include<bits/stdc++.h>
    using namespace std;
    const int N=1e6+5;;
    char a[N],b[N];
    int main()
    {
    	int n;
    	cin>>n;
    	cin>>a;
    	cin>>b;
    	int ans=0;
    	int i,j=n-1;
    	for(i=n-1;i>=0;i--){
    		if(a[i]==b[j]) j--;
    		else ans++;
    	}
    	cout<<ans;
    	return 0;
    }
    
    • 1

    Information

    ID
    6551
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    3
    Tags
    (None)
    # Submissions
    19
    Accepted
    11
    Uploaded By