Search
⌘K
Get Premium
Leetcode 1467. Probability of a Two Boxes Having The Same Number of Distinct Balls
Given counts of k colored balls summing to 2n, compute the probability that after a uniform random shuffle and splitting the first n balls into box A and the rest into box B (boxes labeled), both boxes contain the same number of distinct colors. Core challenge is combinatorial: enumerate all ways to allocate per-color counts to box A summing to n and use multinomial coefficients to count arrangements and compare distinct-color counts to accumulate favorable vs total outcomes.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.