Calculate the number of valid stack permutations

Related Tags