Google Interview Coding question
Anonymous User
2243

Given two lists of Strings with the same set of elements and no duplicates within the list, find out the minimum number of contiguous swaps that are required to get from one list to another.
Example S = [B,C,A,D] and D = [C,D,A,B]

B C A D
C B A D
C A B D
C A D B
C D A B

contiguous swaps means - you can only swap adjacent elements.

Comments (16)