LTIMindtree interview question

Simple Coding and basic concepts