Pergunta de entrevista da empresa Angular Minds

I was not able to pass coding test