Java | 0(1) time and O(1) space
Let x be the jumbo and y be the small burgers two linear equations formed will be\n4x+2y=No.of tomato\nx+y=No.of cheese\nRest can be done by using simple maths\
Let x be the jumbo and y be the small burgers two linear equations formed will be\n4x+2y=No.of tomato\nx+y=No.of cheese\nRest can be done by using simple maths\nPlease upvote if you like the approach\n\n```\n public List<Integer> numOfBurgers(int tomatoSlices, int cheeseSlices) {\n        \n        if((tomatoSlices-2*cheeseSlices)%2!=0){\n            return new ArrayList<>();\n        }\n        \n        int jumbo=(tomatoSlices-2*cheeseSlices)/2;\n        int small=(cheeseSlices-jumbo);\n        \n      \n        \n        List<Integer> result=new ArrayList<>();\n        if(jumbo>=0 && small>=0){\n        result.add(jumbo);\n        result.add(small);\n        return result;\n        }\n        else{\n          return result;\n        }\n       \n    }
['Java']