HackerEarth Select the subset problem solution - TheCScience