Problem Description:
Imagine an exclusive event where attendees arrive at different times. The event starts at time 0. Each attendee undergoes an identification check that takes 5 minutes. If a person arrives and sees more than 10 people in the ID check queue, they leave immediately.
Your task is to implement a function that returns an array of integers representing the time when each person's identification check will be completed. The time should be in seconds since the start of the event.
Function Signature: public static int[] processEvent(int[] arrivalTimes)
Input:
arrivalTimes: An array of integers representing the arrival time of each person.Output:
Rules:
Example:
public static void main(String[] args) {
int[] arrivalTimes = {4, 400, 450, 500};
int[] result = processEvent(arrivalTimes);
// Expected Output: [304, 700, 1000, 1300]
System.out.println(Arrays.toString(result));
}Explanation:
Consider the scenario:
The output array represents the time when each person's identification check will be completed.
Please Note : If the size is already 10 , the processing time of the next person will be same as their arrival time.