RANDOM PICK INDEX | LEETCODE # 398 | PYTHON RESERVOIR SAMPLING

Sdílet
Vložit
  • čas přidán 25. 07. 2024
  • In this video we are solving an interesting Google and Facebook interview question: Random Pick Index (Leetcode # 398).
    This question is a really annoying one. If you've seen the solution it's super easy, if you haven't you probably aren't going to solve it correctly. The solution uses something called reservoir sampling and most of you probably have never seen or heard of that before (I certainly hadn't!).,
    TIMESTAMPS
    00:00 Intro
    00:19 Question Prompt
    01:05 Basic Example + Naive Solution
    04:00 Reservoir Sampling Solution Explained
    10:45 Coding
    13:24 Time/Space Complexity
    14:20 Outro
  • Věda a technologie

Komentáře • 18