closest to store the closest cost found so far, set it to infinity initially.exploreToppings starting with the current base cost, the toppings array, index 0, and the target.exploreToppings, check if the current cost is closer to the target than closest. If so, update closest.exploreToppings for the next topping index with 0, 1, and 2 units of the current topping added to the current cost.closest cost.