JusPay | Coding Round | Min operations to make 2 strings equal
Given 2  binary strings, your task is to make those 2 strings equal by performing following operation
-> select any 2 adjacent characters from any string and flip/invert them i.e 0 -> 1 or 1 -> 0

Find the minimum number of operations required to make 2 strings equal.


For example, A = 0101, B = 1111, the optimal approach is 
first select middle 2 characters from A and invert them, 
then, A becomes 0011.
Now, select first 2 characters from B and invert them, Now, B becomes 0011.
so, A = B.
So, the number of operations required to make A and B equal is 2.


Can anyone help me to solve this?
THANKS in advance.
Comments (3)