BENTELER Hiring Challenge | Off Campus OA (2024) | Remove Stones to Minimize the Total Problem

Question · Posted Jun 2026

Problem Statement You are given an integer array piles, where piles[i] represents the number of stones in the i-th pile, and an integer k representing the number of operations. In one operation: Choose any pile. Remove floor(piles[i] / 2) stones from it. After removing stones, the pile becomes: piles[i] = piles[i] - floor(piles[i] / 2) Perform exactly k operations such that the total number of stones remaining in all piles is minimized. Return the minimum possible total number of stones ...

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

Log in Create a free account