[Java] Simple & easy solution O(1) time O(1) space
```\nclass Solution {\n    public List numOfBurgers(int tomatoSlices, int cheeseSlices) {\n        \n        List ans = new ArrayList<>();\n        \n        //
```\nclass Solution {\n    public List<Integer> numOfBurgers(int tomatoSlices, int cheeseSlices) {\n        \n        List<Integer> ans = new ArrayList<>();\n        \n        // need to solve 2 equations\n        // 4 * jumbo + 2 * small = tomatoSlices, jumbo + small = cheeseSlices\n        \n        if(tomatoSlices % 2 == 1) return ans;\n        \n        int jumbo = tomatoSlices - 2 * cheeseSlices;\n        if(jumbo < 0 || jumbo % 2 == 1) return ans;\n        \n        jumbo /= 2;\n        \n        int small = cheeseSlices - jumbo;\n        if(small < 0) return ans;\n        \n        ans.add(jumbo);\n        ans.add(small);\n        \n        return ans;\n        \n    }\n}
['Math']