Method
get_minimum_time
(time: Vec<i32>, fruits: Vec<Vec<i32>>, limit: i32)
Source from the content-addressed store, hash-verified
| 2 | |
| 3 | impl Solution { |
| 4 | pub fn get_minimum_time(time: Vec<i32>, fruits: Vec<Vec<i32>>, limit: i32) -> i32 { |
| 5 | // tranlate from Ruby to Rust code |
| 6 | // fruits.map{|e|time[e[0]]*(e[1]/limit.to_f).ceil}.sum |
| 7 | fruits.iter().map(|e|time[e[0] as usize]*(e[1] as f64 / limit as f64).ceil() as i32).sum() |
| 8 | } |
| 9 | } |
| 10 | |
| 11 | fn main() { |
Callers
nothing calls this directly
Tested by
no test coverage detected