Infosys Interview Question

Average Question from leetcode to solve