Dinesh Goyal's submission of Perfect Permutation | CodeChef