Easy Java Solution with One Loop
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```java []
class Solution {
    public List<Integer> numOfBurgers(int tomatoSlices, int cheeseSlices) {
        if (tomatoSlices == 0 && cheeseSlices == 0) {
            return new ArrayList<>(Arrays.asList(0, 0));
        }

        int count = 0;
        double tS = tomatoSlices;
        double cS = cheeseSlices;

        while (tS >= 4 && cS >= 1 && (tS/cS) != 2.0) {
            count++;
            tS -= 4;
            cS--;
        }

        List<Integer> list = new ArrayList<>();
        if (tS / cS != 2.0) return list;

        list.add(count);
        list.add((int) (cS));

        return list; 
    }
}
```
['Java']