AUTODESK Hiring | Maximum Product Difference Between Two Pairs | Off Campus OA (2023)

Question · Posted Jun 2026

Problem Statement You are given an integer array nums. Choose four distinct indices w, x, y, and z such that: nums[w] * nums[x] is the product of the first pair. nums[y] * nums[z] is the product of the second pair. Your task is to maximize the following value: (nums[w]×nums[x])−(nums[y]×nums[z])(nums[w] \times nums[x]) - (nums[y] \times nums[z])(nums[w]×nums[x])−(nums[y]×nums[z]) Return the maximum possible product difference. Input Format An integer array nums. Output Format Return an integer representing the maximum product difference. Constraints 4 <= ...

The full answer & interview discussion are available to premium members.

Log in Create a free account