Pergunta de entrevista da empresa Wipro

Question based on the oops followed a coding question.