Airbus | OA | Minimum Absolute Sum: Optimal 2-Point Partitioning | March 2022

Question · Posted Apr 2026

Problem Statement: Minimum Absolute Sum The Objective: Given an array A of N integers, find two integers x and y that minimize the sum of the absolute differences between each element in the array and its closer chosen integer. The Expression to Minimize: i=1∑n​min(∣A[i]−x∣,∣A[i]−y∣) Example Walkthrough: N=4 A=[2,3,6,7] Choice: x=3,y=7 Calculation: ∣2−3∣+∣3−3∣+∣6−7∣+∣7−7∣=1+0+1+0=2. Result: The minimum absolute sum is 2.

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

Log in Create a free account