Infrrd interview question

Normal coding question