HackerEarth Finding Pairs problem solution - TheCScience