Accenture interview question

coding questions diificulty at par with leetcode