Skip to content

Commit 3091f15

Browse files
fix: vla in egg_dropping_puzzel
1 parent b796161 commit 3091f15

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

dynamic_programming/egg_dropping_puzzle.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
#include <climits>
66
#include <iostream>
77
#include <vector>
8+
89
using namespace std;
910

1011
int eggDrop(int n, int k) {
11-
std::vector<std::vector<int> > eggFloor;
12-
eggFloor.reserve(n + 1);
12+
std::vector<std::vector<int> > eggFloor(n + 1, std::vector<int>(k + 1));
1313

1414
int result;
1515

0 commit comments

Comments
 (0)