python, Time: O(1) [100.0%], Space: O(1) [100.0%], full explain
For explain, please see comments.\nI just want to say... who will buy a jumbo burger that only have more tomato? Seriousely?\n\n\n\n# Dev: Chumicat\n# Date: 201
For explain, please see comments.\nI just want to say... who will buy a jumbo burger that only have more tomato? Seriousely?\n\n\n```\n# Dev: Chumicat\n# Date: 2019/12/1\n# Submission: https://leetcode.com/submissions/detail/282876212/\n# (Time, Space) Complexity : O(1), O(1)\n\nclass Solution:\n    def numOfBurgers(self, tomatoSlices: int, cheeseSlices: int) -> List[int]:\n        """\n        :type tomatoSlices: int\n        :type cheeseSlices: int\n        :rtype: List[int]\n        """\n        # Its a simple binary simultaneous equations\n        # We have:\n        #   f1: 4x+2y = tomatoSlices\n        #   f2: x+y = cheeseSlices\n        # Get x (total_jumbo):\n        #   2x = (4x+2y) - (2x+2y)\n        #      = f1 - 2*f2\n        #      = tomatoSlices - 2*cheeseSlices\n        #    x = 0.5*tomatoSlices - cheeseSlices\n        # Get y (total_small):\n        #    y = f1 - x\n        #      = cheeseSlices - x \n        #      = cheeseSlices - (0.5*tomatoSlices - cheeseSlices)\n        #    y = -0.5*tomatoSlices + 2*cheeseSlices\n        # Note:\n        #   We solve the function, but its answer might not fit in this case\n        #   1. We can\'t sell half burger\n        #   2. We can\'t sell negative burger\n        #   3. According to (1) and (2), x and y must be natural number (0 included)\n        #   4. We didn\'t need to worry about error in float, because it just divide by 2,\n        #      which means there will no error occur in this situation\n        x =  0.5*tomatoSlices -   cheeseSlices\n        y = -0.5*tomatoSlices + 2*cheeseSlices\n        \n        if not x.is_integer() or not y.is_integer() or x < 0 or y < 0:\n            return []\n        else:\n            return[int(x), int(y)]\n```\n\nIf you really didn\'t want to use float, well by add a check, we can use only integer\nAnd if your are crazy, so you decide not to use any divide or multiply, well, use shift\nBut this way will let code not let clean since we seperate the return place\n```python\n# Dev: Chumicat\n# Date: 2019/12/1\n# Submission: https://leetcode.com/submissions/detail/282877921/\n# (Time, Space) Complexity : O(1), O(1)\n\nclass Solution:\n    def numOfBurgers(self, tomatoSlices: int, cheeseSlices: int) -> List[int]:\n        """\n        :type tomatoSlices: int\n        :type cheeseSlices: int\n        :rtype: List[int]\n        """\n        # Only tomatoSlices need to be divide\n        # You can also check this first\n        if tomatoSlices & 1: return []\n        \n        x =  (tomatoSlices>>1) - (cheeseSlices)\n        y = -(tomatoSlices>>1) + (cheeseSlices<<1)\n        \n        if x < 0 or y < 0:\n            return []\n        else:\n            return [x, y]\n```
['Python', 'Python3']