solve the permutation sequence problem.