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 e758da3 commit 505f2ecCopy full SHA for 505f2ec
solution/1700-1799/1701.Average Waiting Time/README.md
@@ -161,6 +161,26 @@ function averageWaitingTime(customers: number[][]): number {
161
}
162
```
163
164
+#### Rust
165
+
166
+```rust
167
+impl Solution {
168
+ pub fn average_waiting_time(customers: Vec<Vec<i32>>) -> f64 {
169
+ let mut tot = 0.0;
170
+ let mut t = 0;
171
172
+ for e in customers.iter() {
173
+ let a = e[0];
174
+ let b = e[1];
175
+ t = t.max(a) + b;
176
+ tot += (t - a) as f64;
177
+ }
178
179
+ tot / customers.len() as f64
180
181
+}
182
+```
183
184
#### JavaScript
185
186
```js
0 commit comments