Sliding Window Protocol

One of most asked question on sliding window algorithm is “Fruits in Basket” problem.
There are many variations of this problem but basic premise is to find out subset of an array
where maximum fruits can be put into a basket.

Updated: