Solve Permutation Happiness

Count the number of permutations subject to some constraints Solving code challenges on HackerRank is one of the best ways to prepare for programming interviews.