Salesforce hacker rank OA

There is a gate in an amusement park. There is an entrance queue and an exit queue.
Given two arrays of length n, time[] and direction[] such that time[i] represents
the time when person_i reaches the gate and direction[i] represents whether the
person is joining the entrance queue or exit queue, output an array timestamp[]
of length n such that timestamp[i] represents the time when person_i crosses the
gate. The gate operates as follows:
If the gate was used at time t - 1 for entrance, then entry queue will be preferred.
Else If the gate was used at time t - 1 for exit, then exit queue will be preferred.
Else exit queue will be preferred.
1 <= n <= 10^5
1 <= time[i] <= 10^9
time[i] <= time[i+1]
direction[i] = 0 means entrance, direction[i] = 1 means exit.

楼主是new grad嘛,我之前内推说暂时不招收了?