# This bidirectional technique is useful when we want to get cumulutative information
#  from the left and right of each index
class Solution:
    def get_product_array(self, nums):
        if not nums:
            return None
        result = [1]
        for i in range(1, len(nums)):
            result.append(result[-1] * nums[i - 1])
        
        product_right = 1
        for i in range(len(nums) - 1, -1, -1):
            result[i] *= product_right
            product_right *= nums[i]

        return result

solution = Solution()
nums = [2, 3, 4, 5]
[60, 40, 30, 24]
60
print(solution.get_product_array(nums))
