upGrad interview question

Machine coding round interview the second Round