Nagarro Interview Question

Scenario based question like if this solution is possible or not