Given two binary strings S1 and S2, tell if a binary string K exists, such that continuously subtracting K from both S1 and S2 results in K.
Check if GCD of S1 and S2 exists, other than 1.
First convert the binary strings to integers. Then, simply find if the GCD of the two integers is > 1. If it is, then secret binary code are same, else not.
Solution can be found here.