Amazon Interview Question

Difficulty: MEDIUMCategory: InterviewExperienceFrequency: 1Asked On 2024-10-31Added By Anonymous
Source: Link

Company: Amazon
Role: unknown
Interview Stage: unknown
Location: unknown
Year: unknown

Original Post Content:

Given an array of integers arr[] consisting of N integers, the task is to minimize the sum of the given array by performing at most K operations, where each operation involves reducing an array element arr[i] to floor(arr[i]/2).
k<=1e9 n<=1e5
Time limit-2 sec
Can anyone think an optmized approach better than mlogn?under 2sec

Comments