Sir i did not get the approach of cummulative sum

sir i am unable to understand please make me understand the question .

hello @Mr_Sidd

have u understood the first approach of this problem?