Range add queries (difference array)

Java Hard 5 views
Back to Questions

Problem Description

Task: start with zeros of size n. Each query (l,r,add) adds add to every index in [l,r]. Return final array.

Input Format

Java method

Output Format

Return value

Constraints

Use long; O(n+q).

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev