HackerEarth Minimum Cabs problem solution - TheCScience