Pregunta de entrevista de FactWise

I was asked a Array based coding question.