标签:Google classic throwing egg eggs floor https 100 com
Google classic interview questions, throwing eggs the least number of times All In One
谷歌经典面试题, 扔鸡蛋最少次数 14
✅
你在一栋 100 层的大楼里工作,你得到 2 个相同的鸡蛋。
你需要计算出鸡蛋可以掉落到最高的楼层而不破裂。
问题是你需要投掷多少次。
找到一种在最坏情况下最小化抛出次数的算法。
You work in a 100 floors building and you get 2 identical eggs.
You need to figure out the highest floor an egg can be dropped without breaking.
The question is how many throws you need to make.
Find an algorithm that is minimizing number of throws in the worst-case scenario.
https://www.freecodecamp.org/news/how-to-solve-the-google-recruiters-puzzle-about-throwing-eggs-from-a-building-de6e7ef1755d
LeetCode
https://leetcode.com/problems/super-egg-drop/
https://leetcode-cn.com/problems/super-egg-drop/
demos
<iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen="" frameborder="0" height="315" src="https://www.youtube.com/embed/KVfxgpI3Tv0?si=sUj7_qoK5D8uvDSx&start=6" title="YouTube video player" width="560"></iframe>
<iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen="" frameborder="0" height="315" src="https://www.youtube.com/embed/uBhSIKLlvdk?si=fB_ck-7BguEX0V5E&start=0" title="YouTube video player" width="560"></iframe>