C++ super simple and straight-forward soluiton, beats 100% and can be implemented in 5mins!
```\n    vector products;\n    ProductOfNumbers() {\n        products.clear();\n        products.push_back(1);\n    }\n    \n    void add(int num) {\n        if
```\n    vector<int> products;\n    ProductOfNumbers() {\n        products.clear();\n        products.push_back(1);\n    }\n    \n    void add(int num) {\n        if(num==0)\n        {\n            products.clear();\n            products.push_back(1);\n        }\n        else products.push_back(products.back()*num);\n    }\n    \n    int getProduct(int k) {\n        if(products.size()<=k) return 0; \n        return products.back()/products[products.size()-1-k];\n    }
[]