No same Permutations

Getting correct output in local system. What’s the mistake in my code?

Try this: