A problem on bit strings

Revision en1, by mahmud2690, 2017-02-16 20:01:27

I am recently faced with the following problem. You are given binary string a and b where 1 <= length(a) <= length(b) <= 10^5. Let length(a) = n. Now we are required to find the smallest binary-valued substring S of b with length n where XOR(S, a) is minimum. I thought a solution with bitsets which may avoid TL, but i couldn't made it up. Can anybody help me to solve this, please?

Example: Input: 1101 1011000 Output: 1100

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English mahmud2690 2017-02-16 20:01:27 460 Initial revision (published)