Square Root Decomposition is an effective implementation for an update in an array and answering a range query, for example, given an array find the sum from index 5 to 1004 (both inclusive).
Link to code:-
https://pastebin.com/RcKjLH38
Music Credits:- https://www.bensound.com/
If this helps you like and for more such videos subscribe