Temp solution of Permutation Sequence