Comment

Comment by bart__

The best solution I could think of on the spot was this: First write down every license place until it fills up. Then for each time a car drives by, give it a 1/2 chance to write it down. Moving down the list regardless of the outcome. Then once the bottom is reached, do it again but with 1/3 a chance. Over and over again, decreasing the chance each time.

I checked for which situations it is valid, and it surprisingly was when there are many more cars than the list size. But it is not valid when there are just a few more cars than the list size.

parent bart__ 10 months ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton