#C7095. Minimum Binary Flips

    ID: 50928 Type: Default 1000ms 256MiB

Minimum Binary Flips

Minimum Binary Flips

You are given two binary strings s and t of equal length. In one operation, you can flip a single bit in s (i.e. change a '0' to '1' or a '1' to '0'). Your task is to determine the minimum number of flips required to make s equal to t.

Formally, if we denote the two strings as s = s_1s_2...s_n and t = t_1t_2...t_n, you need to compute the quantity $$\text{answer} = \sum_{i=1}^{n} \mathbf{1}_{\{s_i \neq t_i\}}, $$

where (\mathbf{1}_{{s_i \neq t_i}}) is 1 if (s_i \neq t_i) and 0 otherwise.

Note: You may assume that the input strings are non-empty and of the same length.

inputFormat

The input consists of two lines:

  • The first line contains the binary string s.
  • The second line contains the binary string t.

Both strings have equal length.

outputFormat

Output a single integer representing the minimum number of bit flips required to transform string s into string t.

## sample
010
100
2