Python3 with explanation
if cheese == 0, return [0, 0] only when tomato ==0.\n\nthe tomato/cheese ratio is determined by [2,4]\n\nno matter what the combination is, the number of tomato
if cheese == 0, return [0, 0] only when tomato ==0.\n\nthe tomato/cheese ratio is determined by [2,4]\n\nno matter what the combination is, the number of tomato will always be even.\n\nThen, start with all burger 2, it will cost 2* cheese.\nThe difference between tomato and 2* cheese will be compensated by burger 1. each additional burger 1 will offset 2 extra cheese.\n\n\n```\ndef numOfBurgers(self, tomatoSlices: int, cheeseSlices: int) -> List[int]:\n        if cheeseSlices==0:\n            return [0,0] if tomatoSlices==0 else []\n        elif tomatoSlices/cheeseSlices<2 or tomatoSlices/cheeseSlices>4 or tomatoSlices%2==1:\n            return []\n        else:\n            ans=(tomatoSlices-2*cheeseSlices)//2\n            return [ans,cheeseSlices-ans]\n```
[]