• + 2 comments

    Below link will also help to understand theory behind it. https://www.geeksforgeeks.org/constant-time-range-add-operation-array/