subject

There are 10 floors in a hotel (numbered from 0 to 9). on each floor there are 26 rooms, each marked with a capital letter of the english alphabet (from "a" to "z"). your task is to compute which room was booked most frequently, based on a list of room reservations. the list of reservations consists of n three-character strings. the first character of the string is "+" or "−", which describes whether the room was booked or freed. the second and third characters correspond to the number of the floor and letter of the room, respectively. for example "+4c" means that room c on the 4th floor has just been booked, and "−0g" means that room g on the 0th floor has been freed. you may assume that the list describes a correct sequence of bookings in chronological order; that is, only free rooms can be booked and only booked rooms can be freed. all rooms are initially free. note that this doesn't mean that all rooms have to be free at the end. write a function: class solution { public string solution(string[] a); } that, given an array a consisting of n strings, representing the list of bookings, returns a two-character string consisting the floor number and letter of the room that was booked the most times. it is possible that more than one room might have been booked the same, maximum number of times; in this case, return the one whose identifier is the smallest alpha-numerically. write in java.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 01:00
What can you find the under the privacy policy section of a shopping website?
Answers: 1
question
Computers and Technology, 22.06.2019 07:30
By refraining from constructing a building until they are certain that it will not cause harm to the environment, an organization is adhering to the
Answers: 2
question
Computers and Technology, 23.06.2019 00:30
Which one of the following is considered a peripheral? a software b mouse c usb connector d motherboard
Answers: 2
question
Computers and Technology, 23.06.2019 15:00
Visually impaired individuals generally rely on the for navigation. thus, designers need to ensure that mouse-specific inputs, such as pointing, clicking, and hovering, can be done without a mouse.
Answers: 1
You know the right answer?
There are 10 floors in a hotel (numbered from 0 to 9). on each floor there are 26 rooms, each marked...
Questions
question
History, 20.04.2020 23:03
question
Mathematics, 20.04.2020 23:03
question
Mathematics, 20.04.2020 23:03
Questions on the website: 13722362