Edit: Using inbuilt function for generating permutations is a bad idea. This code works fine till n = 5 but then it takes noticeably long long time to execute. For n = 6, it took 1 minute 19 seconds!
Quick formatting tip: type python after the three backticks to get python formatting (like '''python but with the correct symbol).
I like how you are using the features Python gives you, even if it took a while for me to get it — after a few minutes I realized that the inner for loop was a check to see if the string i is properly formatted.
I made it using python.
Edit: Using inbuilt function for generating permutations is a bad idea. This code works fine till n = 5 but then it takes noticeably long long time to execute. For n = 6, it took 1 minute 19 seconds!
Quick formatting tip: type
python
after the three backticks to get python formatting (like'''python
but with the correct symbol).I like how you are using the features Python gives you, even if it took a while for me to get it — after a few minutes I realized that the inner
for
loop was a check to see if the stringi
is properly formatted.Thanks for this 👍 I was looking for something like this before posting but couldn't find anything.