Given an array, return an array where each element is the product of all the other elements except itself. Implement the solution without division and in O(n) time. Input is an integer array with at least two elements; return an integer array of the same length.
def product_except_self(nums):