Javascript Backtrace - simple and beats 100%
\nvar closestCost = function(baseCosts, toppingCosts, target) {\n    let res = 0;\n    let min = Infinity\n    for (let base of baseCosts) {\n        dfs(base, 
```\nvar closestCost = function(baseCosts, toppingCosts, target) {\n    let res = 0;\n    let min = Infinity\n    for (let base of baseCosts) {\n        dfs(base, 0)\n    }\n    \n    return res\n    \n    function dfs(cost, idx) {\n        if (idx === toppingCosts.length) {\n            if (Math.abs(target-cost) < min) {\n                res = cost\n                min = Math.abs(target-cost)\n            }\n            if (Math.abs(target-cost) == min) {\n                res = Math.min(cost, res)\n            }\n            return\n        }\n        \n        dfs(cost, idx+1)\n        dfs(cost+toppingCosts[idx], idx+1)\n        dfs(cost+toppingCosts[idx]*2, idx+1)\n    }\n};\n```
[]