HackerEarth Median Game problem solution - TheCScience