C++ O(1) solution
class Solution {\npublic:\n    vector numOfBurgers(int t, int c) {\n        vector v;\n        if(4c<t) return v;\n        if((4c-t)%2!=0) return v;\n        \n
class Solution {\npublic:\n    vector<int> numOfBurgers(int t, int c) {\n        vector<int> v;\n        if(4*c<t) return v;\n        if((4*c-t)%2!=0) return v;\n        \n        int x = (4*c-t)/2;\n        if(c-x<0) return v;\n        v.push_back(c-x);\n        v.push_back(x);\n        return v;\n    }\n};
[]