Accenture interview question

easy lvl problem from leetcode top 100 most asked