Pregunta de entrevista de Weave

Leetcode medium question around subarrays.