Skip to content

Commit 1c2e186

Browse files
fix: vla in lisnlogn
1 parent 77e7eba commit 1c2e186

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

dynamic_programming/longest_increasing_subsequence_nlogn.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#include <iostream>
66
#include <set>
7+
#include <vector>
78

89
using namespace std;
910
int LIS(int arr[], int n) {
@@ -32,7 +33,7 @@ int main(int argc, char const* argv[]) {
3233
int n;
3334
cout << "Enter size of array: ";
3435
cin >> n;
35-
int a[n];
36+
std::vector<int> a(n);
3637
cout << "Enter array elements: ";
3738
for (int i = 0; i < n; ++i) {
3839
cin >> a[i];

0 commit comments

Comments
 (0)