ServiceNow | OA | Zero Product
Anonymous User
641

Given an array of integers (both positive negative and zero) you have to find the number of subsequence such that product of maximum and mimum elememt is zero
hint ( take two cases when 0 is maximum element and 0 is minimum element.
For 0 is maximum element we can only take negative numbers answer will be (2^zero-1)*2^negative element
For 0 is maximum element we can only take negative numbers answer will be (2^zero-1)*2^positive element
-1 is the case when we dont have included any zero element ( 0 is c ompulsory to take)

Comments (2)