---
# System prepended metadata

title: 1701. Average Waiting Time
tags: [Leetcode, Simulation, Medium]

---

# 1701. Average Waiting Time
###### tags: `Leetcode` `Medium` `Simulation`
Link: https://leetcode.com/problems/average-waiting-time/description/
## Code
```python=
class Solution:
    def averageWaitingTime(self, customers: List[List[int]]) -> float:
        currTime = 0
        totalWaiting = 0
        for arrival, time in customers:
            if currTime<arrival: currTime = arrival
            currTime += time
            totalWaiting += currTime-arrival
        return totalWaiting/len(customers)
```