Salesforce OA | AMTS | January 2026 Bangalore Off-Campus

Salesforce · Question · Posted Jun 2026

Problem 1: System Energy Reduction Problem Statement You are given an integer n where 0 < n < 2^60. In one operation, you can add or subtract any power of two (i.e. any value of the form 2^x where x >= 0). Find the minimum number of operations needed to reduce n to 0. Constraints 0 < n < 2^60 Each operation: add or subtract exactly one power of two (2^0, 2^1, 2^2, ...) Test Cases Input Output Explanation n ...

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

Log in Create a free account