Binary Search on tomatoes assuming atleast one answer exists
\nclass Solution {\npublic:\n    vector<int> numOfBurgers(int tomatoSlices, int cheeseSlices) {\n        int ans = cheeseSlices;\n        int low = 0, high = an
```\nclass Solution {\npublic:\n    vector<int> numOfBurgers(int tomatoSlices, int cheeseSlices) {\n        int ans = cheeseSlices;\n        int low = 0, high = ans;\n        while(low <= high)\n        {\n            int mid = (low + high) / 2;\n            if((mid * 4) + ((ans - mid) * 2) == tomatoSlices)\n                return {mid, ans - mid};\n           if((mid * 4) + ((ans - mid) * 2) < tomatoSlices)\n               low = mid +1;\n            else\n                high = mid - 1;\n        }\n        return {};\n    }\n};\n```
['Binary Search']