A Week of Bugs, Pointers and Pseudocode in Data Structures & Algorithms
window_sum = window_sum - nums[i] + nums[i + k] This was the course’s own example, and I stared at it for a long time. I knew what each piece was: nums[i] is a number, nums[i + k] is another, and one is subtracted while the other is added. What I couldn't see was why it worked.…