Skip to content

Conversation

@Krishna200608
Copy link

@Krishna200608 Krishna200608 commented Jan 1, 2026

Issue : #109

Summary

This PR adds the C++ solution for the "Easy" problem listed in the Difference Array readme: CSES 1651 - Range Update Queries.

Submission Proof

Link : https://cses.fi/paste/e46fc0236a874a04f11078/

Screenshot

image

Changes Made

  • Solution1.cpp: Implemented the solution using a Fenwick Tree (BIT) backed by the Difference Array concept.
  • Reasoning: While standard difference arrays are static, this problem requires online updates and queries. The implementation achieves O(log N) per operation instead of O(N), ensuring it passes within time limits.

Complexity

  • Time: O((N + Q) log N)
  • Space: O(N)

Checklist

  • Code compiles and passes test cases.
  • Followed directory structure algos/range_queries/DifferenceArray/soln/.
  • Added comments explaining the approach.

@OpenGitBot
Copy link

Hey @Krishna200608

PR Template is not followed. Kindly follow the template & edit it again for consideration as a valid pull request.

Thanks for contributing in OpenCode'25 ✨✨!

Correct Tempelate:
Issue : #<Issue_Number>

1 similar comment
@OpenGitBot
Copy link

Hey @Krishna200608

PR Template is not followed. Kindly follow the template & edit it again for consideration as a valid pull request.

Thanks for contributing in OpenCode'25 ✨✨!

Correct Tempelate:
Issue : #<Issue_Number>

@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