fix: vla in lisnlogn

This commit is contained in:
realstealthninja
2024-10-04 20:36:21 +05:30
parent 77e7ebadb4
commit 1c2e186369

View File

@@ -4,6 +4,7 @@
#include <iostream>
#include <set>
#include <vector>
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<int> a(n);
cout << "Enter array elements: ";
for (int i = 0; i < n; ++i) {
cin >> a[i];