Dubbizle interview question

Problem solving question with code