Arc Technologies interview question

leetcode language agnostic coding problem