We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
so that when the sliciing happens on list squares[i:i+m] , it does not go above the index limit.
as you can see i am doing i+m , while i is going from 0, to len()
In such case, you need to reduce the window.
This is known as Sliding window algorithm.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Subarray Division
You are viewing a single comment's thread. Return to all comments →
so that when the sliciing happens on list squares[i:i+m] , it does not go above the index limit. as you can see i am doing i+m , while i is going from 0, to len() In such case, you need to reduce the window. This is known as Sliding window algorithm.