Leetcode 571. Find Median Given Frequency of Numbers
Given an array of frequencies where freq[i] is the count of value i (counts may be large), compute the median of the implicit multiset without expanding it; handle odd vs even total counts and return the middle value (or average of two middle values) efficiently using prefix sums or binary search on cumulative counts.
Asked at:
Amazon
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
0
Early November, 2024
Junior
Find Median from Data Stream
Hello Interview Premium
Your account is free and you can post anonymously if you choose.