I recently got stumped by a couple of stats related coding questions and was hopping to see if someone here could answer them.
My intuition for this one told me that using something like a mod (%) might be useful here but I couldn't figure out how to keep an even probability
I started using a queue of size k that you would populate until you see k queries. Once you have k+1 queries you have to decide if you are adding that query to your queue and then with some probability you have to decide which element is getting popped from your queue.
Let me know what you think of either of them, I've been tryong to wrap my head around these two all day.