Mphasis Interview Question

Basic question and coding round