IBM interview question

It was an online coding round.