Importance of time

I am not able to understand the question properly and please also tell the logic

hi @kumarakash121005

  • The Idea is to Store the Calling order in Queue and the ideal order in an Array.
  • Then compare front element of the queue with the ideal order.
  • If it matches then increment the time and remove the element.
  • Else, Dequeue the element and enqueue it again.
  • The loop will run till the queue is consumed totally.

refer this code -->

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.