Miro interview question

Leetcode like medium problem on arrays