The well known Hollywood student Greenlight Casting Couch is releasing one of their hits in a directors cut edition. The editor starts with the scenes in the orginal order and repeatedly swaps pairs of scenes until they are in the new order. Given the order of the scenes in the old and new versions of the film. Write a program to determine the smallest number of swaps required to edit the film.
Taken from the 2005 Informatics Olympiad.
Click here to view all the competition tasks.