My Java Solution using linear equation solving with comments and equations
\nclass Solution {\n    public List<Integer> numOfBurgers(int tomatoSlices, int cheeseSlices) {\n        List<Integer> burgers = new ArrayList<>();\n        // 
```\nclass Solution {\n    public List<Integer> numOfBurgers(int tomatoSlices, int cheeseSlices) {\n        List<Integer> burgers = new ArrayList<>();\n        // here we have to solve 4x+2y = tomatoSlices and x + y = cheeseSlice where x = jumbo and y = small\n        // further simplification gives result as 2x = tomato - 2 * cheese and y = cheese - x\n        int variable = (tomatoSlices - 2 * cheeseSlices);\n        if (variable % 2 != 0 || variable < 0) {\n            return burgers;\n        }\n        int jumbo = variable / 2;\n        int small = cheeseSlices - jumbo;\n        if (small < 0) {\n            return burgers;\n        }\n        burgers.add(jumbo);\n        burgers.add(small);\n        return burgers;\n    }\n}\n```
['Java']