回到首页

输入关键词,多个关键词用空格分隔。

← 面试刷题笔记 · 系列目录

The Egg Drop Problem

约 1 分钟
本页目录

The Egg Drop Problem

There is a building of 100 floors. If an egg drops from the Nth floor or above, it will break. If it's dropped from any floor below, it will not break. You're given two eggs. Find N, while minimizing the number of drops for the worst case

Solution

x(x+1) / 2 = number of floors

相关文章