We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 505f2ec commit 6c22464Copy full SHA for 6c22464
solution/1700-1799/1701.Average Waiting Time/README_EN.md
@@ -159,6 +159,26 @@ function averageWaitingTime(customers: number[][]): number {
159
}
160
```
161
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
182
#### JavaScript
183
184
```js
0 commit comments