mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-02-13 07:25:42 +08:00
fix dynamic array in egg_dropping puzzle
This commit is contained in:
@@ -4,10 +4,13 @@
|
||||
|
||||
#include <climits>
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
using namespace std;
|
||||
|
||||
int eggDrop(int n, int k) {
|
||||
int eggFloor[n + 1][k + 1];
|
||||
std::vector<std::vector<int> > eggFloor;
|
||||
eggFloor.reserve(n + 1);
|
||||
|
||||
int result;
|
||||
|
||||
for (int i = 1; i <= n; i++) {
|
||||
|
||||
Reference in New Issue
Block a user