design algorithm accept stream integer retrieve product k integer streamimplement productofnumber classproductofnumber Initializes object streamvoid addint num Appends integer num streamint getproductint k Returns product k number current list you assume current list k numbersthe test case generate time product contiguous sequence number fit single 32bit integer overflowing exampleinputproductofnumbersaddaddaddaddaddgetproductgetproductgetproductaddgetproduct3025423482outputnullnullnullnullnullnull20400null32explanationproductofnumber productofnumber new productofnumbersproductofnumbersadd3 3productOfNumbersadd0 30productofnumbersadd2 302productOfNumbersadd5 3025productOfNumbersadd4 30254productofnumbersgetproduct2 return 20 the product 2 number 5 4 20productofnumbersgetproduct3 return 40 the product 3 number 2 5 4 40productofnumbersgetproduct4 return 0 the product 4 number 0 2 5 4 0productofnumbersadd8 302548productofnumbersgetproduct2 return 32 the product 2 number 4 8 32 constraints0 num 1001 k 4 104at 4 104 call add getproductthe product stream point time fit 32bit integer