Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "bits/stdc++.h"
- using namespace std;
- int main(){
- int n;cin>>n;
- string a,b;
- cin>>a>>b;
- int diff[n];
- for(int i=0;i<n;i++){
- if(a[i]==b[i]) diff[i]=0;
- else diff[i]=1;
- }
- int cnt=0;
- for(int i=0;i<n;i++){
- if(diff[i]==1){
- if(i==0 || diff[i-1]==0){
- cnt++;
- }
- }
- }
- cout<<cnt<<endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement