Skip to content

Latest commit

 

History

History

Minimum Product Subset of an Array

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Given an array a, we have to find minimum product possible with the subset of elements present in the array. The minimum product can be single element also.

Input       :     { -1, -1, -2, 4, 3 }
Output      :     -24
Explanation :     Minimum product will be ( -2 * -1 * -1 * 4 * 3 ) = -24

Input       :     { -1, 0 }
Output      :     -1
Explanation :     -1(single element) is minimum product possible

Input       :     { 0, 0, 0 }
Output      :     0