Compute the product while traversing for subarrays
for i in range ( n ) : NEW_LINE INDENT for j in range ( i , n ) : NEW_LINE INDENT ratio = arr [ i ] NEW_LINE for k in range ( i + 1 , j + 1 ) : NEW_LINE DEDENT DEDENT