MCPcopy Create free account
hub / github.com/StudyRust/leetcode_rust / get_minimum_time

Method get_minimum_time

lcp55-PTXy4P.rs:4–8  ·  view source on GitHub ↗
(time: Vec<i32>, fruits: Vec<Vec<i32>>, limit: i32)

Source from the content-addressed store, hash-verified

2
3impl 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
11fn main() {

Callers

nothing calls this directly

Calls 1

sumMethod · 0.80

Tested by

no test coverage detected