CASE II If all elements are negative and k is odd then max product will be product of rightmost - subarray of size k
if ( A [ n - 1 ] <= 0 and ( k & 1 ) ) : NEW_LINE INDENT for i in range ( n - 1 , n - k + 1 , - 1 ) : NEW_LINE INDENT product *= A [ i ] NEW_LINE DEDENT return product NEW_LINE DEDENT