Back to all patterns

Math / Probability

1 problems • Practice on LeetCode to earn credits

About This Pattern

Master the Math / Probability pattern by practicing these problems organized by difficulty.Focus on the Key Signals - these are the indicators that tell you when to use this pattern.

Medium (1)

Implement Rand10() Using Rand7()

Implement rand10() using rand7() with uniform distribution.

Key Signals:

Rejection samplingUniform distributionProbability theory