Problem 90 Lexicographic Permutations

Back to Problem Solutions forum

anneenna     2020-04-15 06:45:24

Hi all,

I'm really stuck on this one. Are we supposed to generate all the permutations of 12! first, then find item in each given index?

Cause my computer cannot handle generating the permutation of 12! It kept crashing that I had to forcefully restart my computer.

I'm not sure if I'm on a wrong track or my computer is just too dated.

Thanks in advance!

yiannis.chatzitheodorou     2020-04-15 08:18:13

As you said 12 factorial is too much. So brute force approach is rather impossible. This is not a problem of your computer. In order to solve it you must find different approach.

anneenna     2020-04-18 12:57:12

Thanks! I finally went another way and got it.

Please login and solve 5 problems to be able to post at forum