Optimal Japanese Ladder Finder

Enter a permutation and find the minimum ladder to achieve it!