CommScope interview question

Leetcode like question around easy-medium