Dr.Lambda's blog

By Dr.Lambda, history, 2 years ago, In English

This problem is so hard and I was asking so many guys to solve it but they haven't any solution can you find an answer?

You are given two permutations a and b of length n. Print the minimum number of reverses in a you want to make to make the array a equals b.Because they're a permutations so there will be always an answer

Example

5

5 4 1 2 3

1 2 3 4 5

Answer

2

Full text and comments »

  • Vote: I like it
  • -5
  • Vote: I do not like it