Skip to content

Commit 6c22464

Browse files
authored
Update README_EN.md
1 parent 505f2ec commit 6c22464

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

solution/1700-1799/1701.Average Waiting Time/README_EN.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,26 @@ function averageWaitingTime(customers: number[][]): number {
159159
}
160160
```
161161

162+
#### Rust
163+
164+
```rust
165+
impl Solution {
166+
pub fn average_waiting_time(customers: Vec<Vec<i32>>) -> f64 {
167+
let mut tot = 0.0;
168+
let mut t = 0;
169+
170+
for e in customers.iter() {
171+
let a = e[0];
172+
let b = e[1];
173+
t = t.max(a) + b;
174+
tot += (t - a) as f64;
175+
}
176+
177+
tot / customers.len() as f64
178+
}
179+
}
180+
```
181+
162182
#### JavaScript
163183

164184
```js

0 commit comments

Comments
 (0)