From 1c2e1863698bd52d33aed82a9539db3815b8900e Mon Sep 17 00:00:00 2001 From: realstealthninja <68815218+realstealthninja@users.noreply.github.com> Date: Fri, 4 Oct 2024 20:36:21 +0530 Subject: [PATCH] fix: vla in lisnlogn --- dynamic_programming/longest_increasing_subsequence_nlogn.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dynamic_programming/longest_increasing_subsequence_nlogn.cpp b/dynamic_programming/longest_increasing_subsequence_nlogn.cpp index 5c4ecfc49..67b3f61ea 100644 --- a/dynamic_programming/longest_increasing_subsequence_nlogn.cpp +++ b/dynamic_programming/longest_increasing_subsequence_nlogn.cpp @@ -4,6 +4,7 @@ #include #include +#include using namespace std; int LIS(int arr[], int n) { @@ -32,7 +33,7 @@ int main(int argc, char const* argv[]) { int n; cout << "Enter size of array: "; cin >> n; - int a[n]; + std::vector a(n); cout << "Enter array elements: "; for (int i = 0; i < n; ++i) { cin >> a[i];