Pergunta de entrevista da empresa Weave

Leetcode medium question around subarrays.