Minimum Sum After K Halvings
Asked at Oracle · Coding Questions · Difficulty: Medium · Last asked Aug 6, 2025
You are given an array `nums` of non-negative integers and an integer `k`. In one operation you choose an index `i` and replace `nums[i]` with `ceil(nums[i] / 2)`, rounding up. You may perform at most `k` operations, and you may pick the same index more than once. Return the smallest possible sum of the array after your operations.
Loading the problem…
More Oracle interview questions
- Multi-Head Attention from Scratch
- System Design — Event Ingestion + Top-K Aggregation
- OOD — File Management System
- Two-Stack FIFO Queue with Amortized O(1) Operations
- Evaluating an LLM Agent with Subjective, Nondeterministic Outputs
- Same N-ary Tree Comparison