We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
This was a bit tricky! I wasted some time trying to solve it in terms of probabilities when the simpler approach is to simply think about expected values. Remember, the expected wait time for an event is the reciprocal of its probability: if something has a 1/3 chance of occuring each second, you can expect to wait 3 seconds for it to happen. Sounds kind of obvious but maybe it will help someone.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Kundu And Bubble Wrap
You are viewing a single comment's thread. Return to all comments →
This was a bit tricky! I wasted some time trying to solve it in terms of probabilities when the simpler approach is to simply think about expected values. Remember, the expected wait time for an event is the reciprocal of its probability: if something has a 1/3 chance of occuring each second, you can expect to wait 3 seconds for it to happen. Sounds kind of obvious but maybe it will help someone.