@StefanPochmann Yes, you are right. :)
I think that can be solved with the single instance of Random(), as I think same seed from the clock is used for all the Random instances. Thanks for your solution. I will understand your approach. :)
My point is say you pick 1 first.
Let's pick 1 over 2: so in our reservoir we only have 1 still
Now in our reservoir we only have 1. When 3 enters we have a 2/3 chance of picking 1 and a 1/3 chance of picking 3, but a 0 chance of picking 2. Meaning moving forward, there is no chance of getting 2.
Sorry for the inconvenience. I have fixed this by including the definition of ListNode in the default code definition comments. You can click on the reload code definition button above the code editor to view the newest code definition.