category-wise-problems

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

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

Potions

tags: Running Maximum, Minimum, Subsequences.

Intution

implementation ```cpp void solve() { int n; cin >> n; priority_queue pq; ll sum = 0; for (int i = 0; i < n; i++) { int num; cin >> num; pq.push(-num); sum += num; while (sum < 0) { sum += pq.top(); pq.pop(); } } cout << pq.size() << '\n'; } ``` </details>