Closest Dessert Cost

You want to make a dessert. Given baseCosts (flavors), toppingCosts (each can be used 0-2 times), and target, find the closest total cost to target.

Examples
Input: [[1,7],[3,4],10]
Output: 10
Hints

Closest Dessert Cost

You want to make a dessert. Given baseCosts (flavors), toppingCosts (each can be used 0-2 times), and target, find the closest total cost to target.