Python3 97% solution
python\nclass ProductOfNumbers:\n    def __init__(self):\n        self.data = []\n        self.product = 1\n\n    def add(self, num: int) -> None:\n        if n
```python\nclass ProductOfNumbers:\n    def __init__(self):\n        self.data = []\n        self.product = 1\n\n    def add(self, num: int) -> None:\n        if num != 0:\n            self.product *= num\n            self.data.append(self.product)\n        else:\n            self.data = []\n            self.product = 1\n\n    def getProduct(self, k: int) -> int:\n        if len(self.data) < k:\n            return 0\n        if len(self.data) == k:\n            return self.data[-1]\n        else:\n            return int(self.data[-1] / self.data[-1-k])\n```
['Python3']