educative.io

Educative

Why is this problem in the Sliding Window chapter?

Looking at the solution, it doesn’t look like it follows sliding window approach. Any ideas why it is included in this chapter?

Hi electrodrel,
As it has been pointed out in the challenge solution, this problem resembles the technique used in “Maximum Sum Subarray of Size K” section of the same lesson. Further, if you inspect the code further, you will notice it is using the sliding window technique the way it is adding next words turn by turn and then using the indices attained during this process.
Hope this helps.