Cyient interview question

Given a logical problem to solve through coding