WIPRO Hiring | Maximum Product Difference Between Two Pairs | Off campus Online Assessment Question 2025
wipro · Question · Posted Jun 2026
Problem Statement You are given an integer array nums containing positive integers. Your task is to select four distinct elements from the array and form two pairs: First pair: (a, b) Second pair: (c, d) The product difference is defined as: (a×b)−(c×d)(a \times b) - (c \times d)(a×b)−(c×d) Find the maximum possible product difference between the two pairs. To maximize the result: Choose the two largest numbers for the first pair. Choose the two smallest numbers for the second pair. ...
The full answer & interview discussion are available to premium members.
Log in Create a free account