谷歌 OA

Given a hotel which has 10 floors [0-9] and each floor has 26 rooms [A-Z]. You are given a sequence of rooms, where + suggests room is booked, - room is freed. You have to find which room is booked maximum number of times. The rooms are in sequence, that is only a room that is freed is booked. In case, 2 rooms have been booked the same number of times, return the lexographically smaller room.

Example:

Input: ["+1A", “+3E”, “-1A”, “+4F”, “+1A”, “-3E”]
Output: “1A”
Explanation: 1A as it has been booked 2 times.