Dassault Systèmes Interview Question

Asked to solve a logic/algorithmic problem