HackerEarth The smallest permutation problem solution - TheCScience