HackerEarth Assorted Arrangement problem solution - TheCScience