HackerEarth Student Arrangement problem solution - TheCScience