CONTINENTAL AG | Minimum Penalty for a Shop | On-Campus OA (2023)

Question · Posted Jun 2026

Q1: Minimum Penalty for a Shop Problem Statement A shop owner can choose any hour to close the shop. The string customers represents customer visits: 'Y' → Customers arrive. 'N' → No customers. Penalty Rules: If the shop is open and no customers come ('N'), penalty increases by 1. If the shop is closed while customers arrive ('Y'), penalty increases by 1. Return the earliest hour at which the shop should close to minimize the total penalty. Example Input customers ...

The full answer & interview discussion are available to premium members.

Log in Create a free account