Posts

Showing posts with the label Hashcode solution

My solution for hashcode 2021 practice problem that scored 220 million+ points

Image
Problem description : Task : Help the imaginary pizzeria choose the pizzas to deliver to Hash Code teams. And since we want everyone to enjoy their food, let's try to deliver to each team, as many different ingredients as we can. Pizza : Expecting many hungry customers, the pizzeria has already prepared some pizzas with different ingredients. Each pizza can be delivered to at most one team. There can be multiple pizzas with the exact same set of ingredients. For example, there are 5 pizzas available in the pizzeria: Pizza 0: onion, pepper, olive  Pizza 1: mushroom, tomato, basil  Pizza 2: chicken, mushroom, pepper  Pizza 3: tomato, mushroom, basil  Pizza 4: chicken, basil  Note that Pizzas 1 and 3 have the same ingredients, even though they are mentioned in different order. Teams : Teams of 2, 3, or 4 people all ordered pizzas. Each team ordered one pizza per team member, but did not specify what ingredients to put on the pizzas. The pizzeria might not deliver to a team (no pizzas