Problem Brief
Chairs Requirement
FULLTIMEOA
See IBM online assessment and hiring insights
In this challenge, determine the minimum number of chairs to be purchased to accommodate all workers in a new business workroom. There is no chair at the beginning.
There will be a string array of simulations. Each simulation is described by a combination of four characters: C, R, U, and L
C- A new employee arrives in the workroom. If there is a chair available, the employee takes it. Otherwise, a new one is purchased.R- An employee goes to a meeting room, freeing up a chair.U- An employee arrives from a meeting room. If there is a chair available, the employee takes it. Otherwise, a new one is purchased.L- An employee leaves the workroom, freeing up a chair.
Function Description
Complete the minChair function.
minChair has the following parameter(s):
string simulation[n]: an array of strings representing discrete simulations to process.
Return
int[n]: an array of integers denoting the minimal number of chairs required for each simulation.
1Example 1
Input
simulation = ["CRUL"]
Output
[1]
Explanation

In this case, there is only one simulation, At first, there are 0 chairs.
The minimum number of chairs to be purchased in one chair in this case. Result = [1].
CRUL, represented in the table above.
"C": A new employee arrives in the workroom and one chair was purchased."R": An employee goes to the meeting room, freeing up a chair."U": An employee arrives from the meeting room, took the chair available."L": An employee leaves the workroom, freeing up a chair.Constraints
Limits and guarantees your solution can rely on.
1 ≤ n ≤ 1001 ≤ length of each simulation[i] ≤ 10000