HackerEarth Bugs problem solution - TheCScience