C++, 100% Time , 99.7 % space, Minimal Steps
We erase all the elements in our prefix array if we encounter a zero number for addition. That makes sense, because if we multiply a zero with any of the suffix
We erase all the elements in our prefix array if we encounter a zero number for addition. That makes sense, because if we multiply a zero with any of the suffix product, we will make the complete product zero.  But, to make sure no overflow occurs, we append an additional 1 at the end of the array, since 1 is a multiplicative identity. \n\n```\nclass ProductOfNumbers {\npublic:\n    ProductOfNumbers() {\n    }\n    vector<int> nums; \n    void add(int num) {\n        if(num == 0) nums.clear();\n        else if(nums.size() == 0)nums.push_back(1), nums.push_back(num);\n        else nums.push_back(nums.back() * num);\n    }\n    \n    int getProduct(int k) {\n        if(k>= nums.size()) return 0 ;\n        return nums.back()/nums[nums.size()-k-1]; \n    }\n};\n```
['C']