Computers and Technology

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.

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 18:30, naomicervero
What type of weird relationship this is analogy show? dissolve: solidify: : noise: silence
Answers: 2
image
Computers and Technology, 23.06.2019 16:30, 19thomasar
How to do this programming flowchart?
Answers: 3
image
Computers and Technology, 24.06.2019 00:50, anthonycraig0205
3. what is the output of the following statements? temporary object1; temporary object2("rectangle", 8.5, 5); temporary object3("circle", 6, 0); temporary object4("cylinder", 6, 3.5); cout < < fixed < < showpoint < < setprecision(2); object1.print(); object2.print(); object3.print(); object4.print(); object1.set("sphere", 4.5, 0); object1.print();
Answers: 1
image
Computers and Technology, 24.06.2019 13:50, jaystarr9395
Write a program that performs a simple n-body simulation, called "jumping leprechauns." this simulation involves n leprechauns, numberd 1 to n. it maintains a gold value g_i for each leprechaun i, which begins with each leprechaun starting out with a million dollars worth of gold, that is, g_i = 1000000 for each i = 1,. in addition, the simulation also maintains, for each leprachaun, i, a place on the horizon, which is represented as a double-precision floating point number, x_i. in each iteration of the simulation, the simulation processes the leprachauns in order. processing a leprachaun i during its iteration begins by computing a new place on the horizon for i, which is determined by the assignment:
Answers: 3
Do you know the correct answer?
There are 10 floors in a hotel (numbered from 0 to 9). on each floor there are 26 rooms, each marked...

Questions in other subjects: