Leetcode - Random Pick with Weight (Python)

preview_player
Показать описание
June 2020 Leetcode Challenge
Leetcode - Random Pick with Weight
Рекомендации по теме
Комментарии
Автор

Thank you for the amazing videos. Very very useful.

ps-vqwf
Автор

You have such a straight forward way of explaining. Honestly this was better than the other videos on youtube. The solution is not efficient, but now I know how to get to an efficient solution. Thank you!

fdm
Автор

Easy to understand and straightforward to implement.

ChalChalaChalRahi
Автор

Man whenever I don't know how to solve a leetcode problem I search your channel first

hangchen
Автор

This is a very smart solution, how do you come up with these ?

Rancha
Автор

Love bumping into your videos. Thanks!

TheAlexanderEdwards
Автор

Hi! Thanks for making this video. Why does it work by using less than? Wouldnt it need to be greater than because the list needs to be in ascending order?

nikitayurkov
Автор

Don't follow this solution entirely. Instead of looping directly, you can binary search that list until L < R and then return L

BRBallin
Автор

And one more thing, you said random.choices didn't work random.randint worked, there is some way of testing issue as all random functions will tend to pick different values. So, I guess due to previously set testing strategy, it is happening. Where did you learn python, please give an advice .?

armanbeerdhindsa
join shbcf.ru