Random Pick With Weight | LeetCode 528 | C++, Java, Python
Vložit
- čas přidán 6. 09. 2024
- LeetCode Solutions: • LeetCode Solutions | L...
June LeetCoding Challenge: • Playlist
May LeetCoding Challenge: • Playlist
*** Best Books For Data Structures & Algorithms for Interviews:*********
1. Cracking the Coding Interview: amzn.to/2WeO3eO
2. Cracking the Coding Interview Paperback: amzn.to/3aSSe3Q
3. Coding Interview Questions - Narasimha Karumanchi: amzn.to/3cYqjkV
4. Data Structures and Algorithms Made Easy - N. Karumanchi: amzn.to/2U8FrDt
5. Data Structures & Algorithms made Easy in Java - N. Karumanchi: amzn.to/2U0qZgY
6. Introduction to Algorithms - CLR - Cormen, Leiserson, Rivest: amzn.to/2Wdp8rZ
*****************************************************************************
June LeetCoding Challenge | Problem 5 | Random Pick With Weight | 5 June,
Facebook Coding Interview question,
google coding interview question,
leetcode,
Random Pick With Weight,
Random Pick With Weight c++,
Random Pick With Weight Java,
Random Pick With Weight python,
Random Pick With Weight solution,
528. Random Pick With Weight,
#Facebook #CodingInterview #LeetCode #JuneLeetCodingChallenge #Google #Amazon
Your explanations are bang on! I wish i had teachers like you in my university
Thanks for the compliment.
I was asked this question twice by Facebook.
Good to know.
Thanks for sharing the info.
Hi what is the intution behind using cummulative probabilites ?
what they actually meant in the output portion, I meant how they are related to our return value
For large input sets they may be evaluating if the fraction of generated indices are roughly close to their weights in input.
Thank for the video. We are using random function so how does answer suppose to be match their expected answer in sample cases? I do understand that it should work on larger samples? Please explain.
Thank you :). Great explanation
Welcome.
Please make a video on comperators.
yes sir, much needed
would time complexity be O(NlogN)?
why haven't u used lower_bound it would have been more appropriate, but using lower_bound gives wrong ans from larger test input may you please explain that,
BTW, really nice explanation.
Using upper bound works.