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:30
How will you cite information that is common knowledge in your research paper?
Answers: 1
question
Computers and Technology, 22.06.2019 15:00
Which of the following has not been attributed at least in part to social media a. drug addiction b. depression c. kidnapping d. murder
Answers: 2
question
Computers and Technology, 22.06.2019 16:50
Consider a slotted aloha system, where the time slot equals the fixed duration of each packet. assume that there are 4 stations a,b,c,d sharing the medium. (a) stations a,b,c,d receive one packet each from higher layers at times 1.3, 1.5, 2.6,5.7 respectively. show which transmissions take place when, according to the slottedaloha protocol; describe all transmissions until all four packets have been successful.when needed, each station has access to the following sequence of random number, provided by a random number generator and drawn uniformly between 0 and 1: (1) station a draws numbers: 0.31, 0.27, 0.78, 0.9, 0.9, 0.11, 0. (2) station b draws numbers: 0.45, 0.28, 0.11, 0.83, 0.37, 0.22, 0. (3)station c draws numbers: 0.1, 0.2, 0.3, 0.4, 0. (4) station d draws numbers: 0.36, 0.77, 0.9, 0.1, 0.1, 0.1, 0.1, 0. (b) in slotted aloha, a station transmits in each time slot with a given probability. what probabilities would you assign to each of the four stations so as to: (i) maximize the efficiency of the protocol? (ii) maximize fairness among the four stations? (c) will the efficiency increase or decrease if we modify slotted aloha as follows: (i) get rid of slots and allow stations to transmit immediately? (ii) implement carrier sensing? (iii) implement collision detection? (iv) implement collision avoidance?
Answers: 3
question
Computers and Technology, 23.06.2019 10:00
Whats three fourths of 15(this is supposed to be in math but i clicked too fast)
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
Mathematics, 28.02.2020 18:56
Questions on the website: 13722362