拒绝采样 是技术面试里最常出现的能力维度之一。建议先掌握基础题型的边界处理,再逐步过渡到模式识别和复杂度 trade-off。
高频考察问题建模、边界条件与口头表达的清晰度。
只背模板不解释为什么,容易在追问里失分。
每轮练 3-5 题,固定复盘复杂度和可替代解法。
基础题感
模式过渡
高强度实战
用 Rand7() 实现 Rand10()
Generate uniform random numbers from 1 to 10 using only rand7(), applying rejection sampling for consistent probability …
在圆内随机生成点
Generate Random Point in a Circle requires creating a uniform random point inside a circle using math and geometry princ…
数学·结合·rejection·sampling
1 道关联题
数学·结合·几何