Product of all non repeating Subarrays of an Array | Function to find the product of all non - repeating Subarrays of an Array ; Finding the occurrence of every element ; Iterating through the array and finding the product ; We are taking the power of each element in array with the occurrence and then taking product of those . ; Driver code
def product ( arr ) : NEW_LINE INDENT occurrence = pow ( 2 , len ( arr ) - 1 ) ; NEW_LINE product = 1 ; NEW_LINE for i in range ( 0 , len ( arr ) ) : NEW_LINE INDENT product *= pow ( arr [ i ] , occurrence ) ; NEW_LINE DEDENT return product ; NEW_LINE DEDENT arr = [ 10 , 3 , 7 ] ; NEW_LINE print ( product ( arr ) ) ; NEW_LINE