dp solution for Swap Permutation