Skip to content

Conversation

@Krishna200608
Copy link

@Krishna200608 Krishna200608 commented Jan 1, 2026

Issue: #108

Summary

Added two well-structured and well-documented C++ solutions that demonstrate core Prefix Sum techniques under
algos/range_queries/prefixSum/soln/.

  • Solution1.cpp
    Implements efficient range sum queries using prefix sums, achieving
    O(N) preprocessing time and O(1) time per query.

  • Solution2.cpp
    Solves the problem of counting subarrays with a given sum using a combination of
    prefix sums and hashing, with an overall O(N) time complexity.

Both solutions include:

  • Clear and concise problem statements
  • Step-by-step explanations of the approach
  • Detailed time and space complexity analysis

All files compile successfully and are organized for readability, learning, and reuse.


Proof of Correctness (Codeforces Submissions)

Problem: Codeforces 1605B — Reverse Sort
Submission Link: https://codeforces.com/contest/1605/submission/356073603 image

Problem: Codeforces 1843E — Tracking Segments
Submission Link: https://codeforces.com/contest/1843/submission/356073814 image

@OpenGitBot
Copy link

Hey @Krishna200608

Thanks for opening this PR 🚀. Mentor will review your pull request soon and till then, keep contributing and stay calm.

Thanks for contributing in OpenCode'25 ✨✨!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants