BNY Mellon | Maximum Binary Sum | OA

Question · Posted Apr 2026

Problem: Maximum Binary Sum The Objective: Given N binary numbers, each with a fixed length of numberOfBits, you want to maximize their total sum. You are allowed to perform at most maximumOperationsAllowed operations. The Operation: Choose any of the N numbers and change it to its 1's complement (flip all 0s to 1s and all 1s to 0s). Constraints: 1≤maximumOperationsAllowed≤109 1≤∣arr∣≤103 (Total numbers N) 1≤numberOfBits≤103 Result must be a binary string with no leading zeros.

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

Log in Create a free account