[C++] Simple Backtracking | Faster than 99%
Rules: \n    1.You must have a base\n    2. Number of toppings can be 0 or 1 or 2  \nSo for each base find the total cost nearest to target by including either 
Rules: \n    1.**You must have a base**\n    2. Number of toppings can be 0 or 1 or 2  \nSo for each base find the total cost nearest to target by including either 0 or 1 or 2 toppings. Find the minimum by doing this all bases. \n\n```\nclass Solution {\npublic:\n    int ans , n; \n    \n    void helper(int currCost , int idx , vector<int>& toppingCosts, int &target) {\n        \n        if(abs(target-currCost) < abs(target - ans)  || (abs(target-currCost) == abs(target - ans)) && currCost < ans)\n            ans = currCost;\n        if(idx>=n || currCost>target)\n            return;\n        helper(currCost , idx+1, toppingCosts , target);\n        helper(currCost+toppingCosts[idx] , idx+1, toppingCosts , target);\n        helper(currCost+toppingCosts[idx]*2 , idx+1, toppingCosts , target);\n    }\n    \n    int closestCost(vector<int>& baseCosts, vector<int>& toppingCosts, int target) {\n        ans = INT_MAX;\n        n = toppingCosts.size();\n        for(auto b: baseCosts) {\n            helper(b,0,toppingCosts , target);\n        }\n        return ans;\n    }\n};\n```
['Backtracking', 'C', 'C++']