You are given two binary strings \(S\) and \(T\) of the same length \(N\). Your task is to make both the strings equal. Perform the following operation on string \(S\):
Select any substring of \(S\) then flip all 1's to 0 and flip all 0's to 1 of that substring.
Print the minimum number of operations you have to perform to make them equal.
Input format
- The first line contains a single integer \(N\) (\(1\le N\le 1e5\)) size of each string
- The second line contains a string \(S\) of length \(N\).
- The third line contains a string \(T\) of length \(N\).
Output format
Print a single integer denoting the minimum number of operations required to make both the strings equal.
Constraints
\(1\le N\le 1e5\)
You just need to flip second 0 to 1.
So answer is 1.
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor
Login to unlock the editorial
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor