Skip to content

Commit

Permalink
fix: typo
Browse files Browse the repository at this point in the history
  • Loading branch information
azl397985856 committed Mar 31, 2020
1 parent eb94452 commit 87cda1a
Showing 1 changed file with 1 addition and 82 deletions.
83 changes: 1 addition & 82 deletions problems/887.super-egg-drop.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,88 +108,8 @@ Note:

## 代码

```js

/*
* @lc app=leetcode id=887 lang=javascript
*
* [887] Super Egg Drop
*
* https://leetcode.com/problems/super-egg-drop/description/
*
* algorithms
* Hard (24.64%)
* Total Accepted: 6.2K
* Total Submissions: 24.9K
* Testcase Example: '1\n2'
*
* You are given K eggs, and you have access to a building with N floors from 1
* to N.
*
* Each egg is identical in function, and if an egg breaks, you cannot drop it
* again.
*
* You know that there exists a floor F with 0 <= F <= N such that any egg
* dropped at a floor higher than F will break, and any egg dropped at or below
* floor F will not break.
*
* Each move, you may take an egg (if you have an unbroken one) and drop it
* from any floor X (with 1 <= X <= N).
*
* Your goal is to know with certainty what the value of F is.
*
* What is the minimum number of moves that you need to know with certainty
* what F is, regardless of the initial value of F?
*
*
*
*
*
*
*
* Example 1:
*
*
* Input: K = 1, N = 2
* Output: 2
* Explanation:
* Drop the egg from floor 1. If it breaks, we know with certainty that F = 0.
* Otherwise, drop the egg from floor 2. If it breaks, we know with certainty
* that F = 1.
* If it didn't break, then we know with certainty F = 2.
* Hence, we needed 2 moves in the worst case to know what F is with
* certainty.
*
*
*
* Example 2:
*
*
* Input: K = 2, N = 6
* Output: 3
*
*
*
* Example 3:
*
*
* Input: K = 3, N = 14
* Output: 4
*
*
*
*
* Note:
*
*
* 1 <= K <= 100
* 1 <= N <= 10000
*
*
*
*
*
*/
```js
/**
* @param {number} K
* @param {number} N
Expand All @@ -205,7 +125,6 @@ var superEggDrop = function(K, N) {
for (let k = 1; k <= K; ++k)
dp[m][k] = dp[m - 1][k - 1] + 1 + dp[m - 1][k];
}
console.log(dp);
return m;
};
```

0 comments on commit 87cda1a

Please sign in to comment.