When randomizing the order of Lord Of The Keys, the number of possible unique permutations in which we can obtain keys is given by:
However, there are some restrictions:
Therefore, the total number of valid permutations is:
Built by Marclap. The source code is available on Github.