I am having an array A which is having n elements. I want to find out the multiplication of all the elements in all the sub arrays possible of array A. I am expecting the solution to be implemented with the help of DP. I want to store all the product values in an array B. I am beginner to programming. I have done a lot of google search but i was unable to find the exact solution to my query. Can anybody help me to provide me the logic of the question. Example:
A={1,2,3}
All possible sub arrays are
{{1},{2},{3},{1,2},{1,3},{2,3},{1,2,3}}
so all possible products are
{1,2,3,2,3,6,6}
respectively.
Any help is appreciable. Thanks in advance.