Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Minimize Peak Mobile Memory

HardPython00:00
Practice interviewer
In session
5 left
00:00

Your question is Minimize Peak Mobile Memory. Start with the requirements on the right.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.

Problem

Given an integer array usage and an integer k, each operation chooses one element and replaces it with floor(value / 2). Return the minimum possible value of the maximum element after at most k operations.

Constraints

  • 1 <= usage.length <= 10^5
  • 0 <= usage[i] <= 10^9
  • 0 <= k <= 10^9
Your solutionPython 3
You need to log in / sign up to run or submit.
Run your code to see test output