Convert one string into other

Revision en1, by xecute, 2015-06-30 00:45:31

There are two string A and B. In one move, one carry out either of the following two operations. 1)Swap two adjacent elements of either A and B 2)Swap the first and last element of either A and B. What is the minimum number of operations required so that the two strings become alike. If n=length of strings and A and B, then 1<=n<=10^5. Any pointers on how to approach this problem ?

Tags strings

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English xecute 2015-06-30 00:45:31 418 (published)