HackerEarth Number of Chocolates partially solved