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];