Enosis Solution Interview Question

The question was based on beginner-level competitive programming problem types.