How to Compute the Product of Last K elements in Array using the Prefix Product Algorithm?
Implement the class ProductOfNumbers that supports two methods: 1. add(int num) Adds the number num to the back of the current list of numbers. 2. getProduct(int k) Returns the …