Minimum Stones Left After Halving Operations

Asked at Snowflake · Coding Questions · Difficulty: Medium

You are given a list of piles of stones and a number of operations. In one operation you choose any pile and remove half of its stones, rounded down. Apply exactly `k` operations and make the number of stones left as small as possible.

Loading the problem…