Back to Browse

[MEDIUM] Leetcode 528: Random pick with Weight

363 views
Feb 23, 2021
16:19

We tackle this problem of designing a random number generator with given weights. We translate the weights into cumulative distance and then optimize the solution with Binary Search. The problem has been asked at Amazon, Google, Facebook and Apple. ========================================== GET MORE EXCLUSIVE INTERVIEW QUESTIONS TO CRACK YOUR INTERVIEWS! Subscribe to “Cracking the FAANG Interviews”: https://www.youtube.com/channel/UCNrJBUctqwkRlL4TArUb-VQ?sub_confirmation=1 Follow us on Facebook: https://www.facebook.com/crackFAANG/ Follow on on Twitter: https://twitter.com/CrackFaang CRACKING THE CODING INTERVIEW BOOK: https://www.amazon.com/gp/product/0984782850/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=0984782850&linkCode=as2&tag=crackingfaang-20&linkId=5a26b319c0cabc0587f206dd5f6a0d73 CRACKING THE SYSTEM DESIGN BOOK: https://www.amazon.com/gp/product/B08CMF2CQF/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=B08CMF2CQF&linkCode=as2&tag=crackingfaang-20&linkId=197dfe477c5bbb6340a3204fe0705ef5 Apple iPad (Video recorded by): https://www.amazon.com/gp/product/B08J61FCVN/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=B08J61FCVN&linkCode=as2&tag=crackingfaang-20&linkId=4fc23c97558d67749847088431b402e5 ========================================== Leetcode link: https://leetcode.com/problems/random-pick-with-weight/ Like, Share and Subscribe to Cracking the FAANG interviews.

Download

0 formats

No download links available.

[MEDIUM] Leetcode 528: Random pick with Weight | NatokHD