category-wise-problems

contains category wise problems(data structures, competitive) of popular platforms.

View the Project on GitHub mayankdutta/category-wise-problems

Thanos Sort

Code ```cpp int ans = 1; std ::vector arr; void divide_conquer(int l, int r) { if (l >= r) return; int mid = (l + r) / 2; divide_conquer(l, mid); divide_conquer(mid + 1, r); bool flag = true; for (int i = l; i < r; i++) flag = (flag && (arr[i] <= arr[i + 1])); if (flag) ans = max(ans, r - l + 1); } void solve() { int n; cin >> n; arr = std ::vector(n); for (auto &i : arr) cin >> i; divide_conquer(0, n - 1); cout << ans << '\n'; } ``` </details>