Cards Permutation Hackerrank Solution In Python