Infosys interview question

Simple leetcode questions like easy-medium.