diff --git a/solution/1276.Number of Burgers with No Waste of Ingredients/javaSolution b/solution/1276.Number of Burgers with No Waste of Ingredients/javaSolution new file mode 100644 index 0000000000000..4fa1bdfc0bba0 --- /dev/null +++ b/solution/1276.Number of Burgers with No Waste of Ingredients/javaSolution @@ -0,0 +1,13 @@ +public List numOfBurgers(int tomatoSlices, int cheeseSlices) { + List burgers = new ArrayList<>(); + //巨无霸汉堡A,小皇堡B + if (tomatoSlices % 2 == 1 || tomatoSlices > cheeseSlices * 4 || cheeseSlices > tomatoSlices / 2) { + return burgers; + } + int A = (tomatoSlices-2*cheeseSlices)/2, B = cheeseSlices-A; + burgers.add(A); + burgers.add(B); + return burgers; +} + +