Search
⌘K

Leetcode 1093. Statistics from a Large Sample

Given a frequency array count[0..255] representing a large multiset, compute the minimum and maximum as the first/last indices with nonzero counts, the mean as the weighted average, the mode as the index with largest count, and the median by finding the middle value(s) using cumulative frequencies (handling even/odd total sizes).


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.